diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-07-15 15:56:02 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-07-15 15:57:11 +0200 |
commit | 5626e812d2c1c202f749824905b70cdb8a845e7b (patch) | |
tree | fe14db2b526b8c91de0a4818e6d9b1ef34fc85d8 /ffprobe.c | |
parent | fda968aa8febe384038aa0a41df8b8e1bb28c5ae (diff) | |
download | ffmpeg-5626e812d2c1c202f749824905b70cdb8a845e7b.tar.gz |
ffprobe: only decode frame if the codec is available
Fix crash when a stream codec is unknown, in particular fix trac
ticket #1243.
Diffstat (limited to 'ffprobe.c')
-rw-r--r-- | ffprobe.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |