diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-06-01 21:40:56 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-06-02 10:33:40 +0400 |
commit | f284e85714527dceb0876c0dee39cc7a3228bed9 (patch) | |
tree | f0cbed633d1e7f50616608fc8eedb2ca24115575 /libavformat/utils.c | |
parent | 22d1b2498228ee1c39a6d9750b7c0be65c08cc8b (diff) |
Report "unknown codec" instead of "unspecifed size" if the codec is unknown.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 1f722410b2..6df426b8d9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2644,6 +2644,9 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr) return 0; \ } while (0) + if ( avctx->codec_id == AV_CODEC_ID_NONE + && avctx->codec_type != AVMEDIA_TYPE_DATA) + FAIL("unknown codec"); switch (avctx->codec_type) { case AVMEDIA_TYPE_AUDIO: if (!avctx->frame_size && determinable_frame_size(avctx)) @@ -2675,8 +2678,6 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr) if (avctx->codec_id == AV_CODEC_ID_NONE) return 1; } - if (avctx->codec_id == AV_CODEC_ID_NONE) - FAIL("unknown codec"); return 1; } |