avfilter/lavfutils/ff_load_image: Return error if no frame could be decoded
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 15 Aug 2014 23:31:37 +0000 (01:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 15 Aug 2014 23:34:34 +0000 (01:34 +0200)
Based-on suggestion by JULIAN GARDNER <joolzg@btinternet.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/lavfutils.c

index ebdf8f8..80310d2 100644 (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);
     if (ret < 0 || !frame_decoded) {
         av_log(log_ctx, AV_LOG_ERROR, "Failed to decode image from file\n");
+        if (ret >= 0)
+            ret = -1;
         goto end;
     }