You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
ffprobe: only decode frame if the codec is available
Fix crash when a stream codec is unknown, in particular fix trac ticket #1243.
This commit is contained in:
@@ -1661,6 +1661,7 @@ static av_always_inline int get_decoded_frame(AVFormatContext *fmt_ctx,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
*got_frame = 0;
|
*got_frame = 0;
|
||||||
|
if (dec_ctx->codec) {
|
||||||
switch (dec_ctx->codec_type) {
|
switch (dec_ctx->codec_type) {
|
||||||
case AVMEDIA_TYPE_VIDEO:
|
case AVMEDIA_TYPE_VIDEO:
|
||||||
ret = avcodec_decode_video2(dec_ctx, frame, got_frame, pkt);
|
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);
|
ret = avcodec_decode_audio4(dec_ctx, frame, got_frame, pkt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user