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@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Jan Sebechlebsky 2016-05-02 02:51:25 +03:00 committed by Michael Niedermayer
parent 1fee770a1c
commit 0ff3489534
1 changed files with 2 additions and 0 deletions

View File

@ -86,6 +86,8 @@ static int mjpeg2jpeg_filter(AVBSFContext *ctx, AVPacket *out)
uint8_t *output; uint8_t *output;
ret = ff_bsf_get_packet(ctx, &in); ret = ff_bsf_get_packet(ctx, &in);
if (ret < 0)
return ret;
if (in->size < 12) { if (in->size < 12) {
av_log(ctx, AV_LOG_ERROR, "input is truncated\n"); av_log(ctx, AV_LOG_ERROR, "input is truncated\n");