diff --git a/libavcodec/mjpeg2jpeg_bsf.c b/libavcodec/mjpeg2jpeg_bsf.c index 2d4cee2ac1..6f02bc033c 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");