[FFmpeg-cvslog] avcodec/mjpeg2jpeg_bsf: Check ff_bsf_get_packet success
Jan Sebechlebsky
git at videolan.org
Mon May 2 04:25:08 CEST 2016
ffmpeg | branch: master | Jan Sebechlebsky <sebechlebskyjan at gmail.com> | Mon May 2 02:51:25 2016 +0300| [0ff3489534ea8ee3bdaf2680a45300d21078bf3e] | committer: Michael Niedermayer
avcodec/mjpeg2jpeg_bsf: Check ff_bsf_get_packet success
This fixes ticket #5487 - mjpeg2jpeg bitstream filter causes
segmentation fault with header-less mjpeg.
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ff3489534ea8ee3bdaf2680a45300d21078bf3e
---
libavcodec/mjpeg2jpeg_bsf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavcodec/mjpeg2jpeg_bsf.c b/libavcodec/mjpeg2jpeg_bsf.c
index 2d4cee2..6f02bc0 100644
--- a/libavcodec/mjpeg2jpeg_bsf.c
+++ b/libavcodec/mjpeg2jpeg_bsf.c
@@ -86,6 +86,8 @@ static int mjpeg2jpeg_filter(AVBSFContext *ctx, AVPacket *out)
uint8_t *output;
ret = ff_bsf_get_packet(ctx, &in);
+ if (ret < 0)
+ return ret;
if (in->size < 12) {
av_log(ctx, AV_LOG_ERROR, "input is truncated\n");
More information about the ffmpeg-cvslog
mailing list