diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c index 3446f2a4f1..7a6bbe491b 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--;