[FFmpeg-devel] [PATCH 3/3] lavf/mpjpeg: do not include CRLF preceding boundary as, part of the returned frame

Alexander Agranovsky alex at sighthound.com
Sun Feb 14 05:49:06 CET 2016


-------------- next part --------------
From b2ef061db32933e896dbeecb68268a62c47d6e0a Mon Sep 17 00:00:00 2001
From: Alex Agranovsky <alex at sighthound.com>
Date: Sat, 13 Feb 2016 23:16:45 -0500
Subject: [PATCH 3/3] lavf/mpjpeg: do not include CRLF preceding boundary as
 part of the returned frame

Signed-off-by: Alex Agranovsky <alex at sighthound.com>
---
 libavformat/mpjpegdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index 2a46671..9d539bb 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -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--;
-- 
2.5.4 (Apple Git-61)



More information about the ffmpeg-devel mailing list