[FFmpeg-cvslog] ffprobe: only decode frame if the codec is available

Stefano Sabatini git at videolan.org
Sun Jul 15 16:38:50 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sun Jul 15 15:56:02 2012 +0200| [5626e812d2c1c202f749824905b70cdb8a845e7b] | committer: Stefano Sabatini

ffprobe: only decode frame if the codec is available

Fix crash when a stream codec is unknown, in particular fix trac
ticket #1243.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5626e812d2c1c202f749824905b70cdb8a845e7b
---

 ffprobe.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/ffprobe.c b/ffprobe.c
index 1f6e048..7113651 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1661,6 +1661,7 @@ static av_always_inline int get_decoded_frame(AVFormatContext *fmt_ctx,
     int ret = 0;
 
     *got_frame = 0;
+    if (dec_ctx->codec) {
     switch (dec_ctx->codec_type) {
     case AVMEDIA_TYPE_VIDEO:
         ret = avcodec_decode_video2(dec_ctx, frame, got_frame, pkt);
@@ -1670,6 +1671,7 @@ static av_always_inline int get_decoded_frame(AVFormatContext *fmt_ctx,
         ret = avcodec_decode_audio4(dec_ctx, frame, got_frame, pkt);
         break;
     }
+    }
 
     return ret;
 }



More information about the ffmpeg-cvslog mailing list