avfilter/lavfutils/ff_load_image: Return error if no frame could be decoded

Based-on suggestion by JULIAN GARDNER <joolzg@btinternet.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-16 01:31:37 +02:00
parent 11aab8d6cb
commit 65f05eff0a
1 changed files with 2 additions and 0 deletions

View File

@ -77,6 +77,8 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
ret = avcodec_decode_video2(codec_ctx, frame, &frame_decoded, &pkt); ret = avcodec_decode_video2(codec_ctx, frame, &frame_decoded, &pkt);
if (ret < 0 || !frame_decoded) { if (ret < 0 || !frame_decoded) {
av_log(log_ctx, AV_LOG_ERROR, "Failed to decode image from file\n"); av_log(log_ctx, AV_LOG_ERROR, "Failed to decode image from file\n");
if (ret >= 0)
ret = -1;
goto end; goto end;
} }