lavf/mpjpeg: do not include CRLF preceding boundary as part of the returned frame
authorAlex Agranovsky <alex@sighthound.com>
Sun, 14 Feb 2016 04:16:45 +0000 (23:16 -0500)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 14 Feb 2016 12:48:33 +0000 (13:48 +0100)
Signed-off-by: Alex Agranovsky <alex@sighthound.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mpjpegdec.c

index 3446f2a..7a6bbe4 100644 (file)
@@ -351,8 +351,8 @@ static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
             do {
                 if (!memcmp(start, mpjpeg->searchstr, mpjpeg->searchstr_len)) {
                     // got the boundary! rewind the stream
-                    avio_seek(s->pb, -(len-2), SEEK_CUR);
-                    pkt->size -= (len-2);
+                    avio_seek(s->pb, -len, SEEK_CUR);
+                    pkt->size -= len;
                     return pkt->size;
                 }
                 len--;