Revision 9515c0c1

View differences:

libavcodec/mjpeg.c
1681 1681
    while (buf_ptr < buf_end) {
1682 1682
        v = *buf_ptr++;
1683 1683
	v2 = *buf_ptr;
1684
        if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe)) {
1684
        if ((v == 0xff) && (v2 >= 0xc0) && (v2 <= 0xfe) && buf_ptr < buf_end) {
1685 1685
	    val = *buf_ptr++;
1686 1686
	    goto found;
1687 1687
        }
......
1874 1874
        }
1875 1875
    }
1876 1876
the_end:
1877
    if(buf_ptr > buf_end)
1878
      buf_ptr = buf_end;
1879

  
1880 1877
    dprintf("mjpeg decode frame unused %d bytes\n", buf_end - buf_ptr);
1881 1878
//    return buf_end - buf_ptr;
1882 1879
    return buf_ptr - buf;

Also available in: Unified diff