diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-11-29 16:16:15 +0100 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-11-29 16:16:15 +0100 |
commit | 2e4d10ae553a867a222d4e4e0a0dfd1dc1b70b97 (patch) | |
tree | b6c5973f89457a93f38cd1c014bed74aaf5a1440 | |
parent | f62fe535d5c08562abcc1b302b0220c95acb307d (diff) | |
parent | 62f72b40c0b0d2cd6a2b81977287fa01d9f4ca6d (diff) | |
download | ffmpeg-2e4d10ae553a867a222d4e4e0a0dfd1dc1b70b97.tar.gz |
Merge commit '62f72b40c0b0d2cd6a2b81977287fa01d9f4ca6d'
* commit '62f72b40c0b0d2cd6a2b81977287fa01d9f4ca6d':
nut: Provide more information on failure
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r-- | libavformat/nutdec.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 62427fc092..7ae7938bb6 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -264,7 +264,9 @@ static int decode_main_header(NUTContext *nut) GET_V(nut->time_base[i].num, tmp > 0 && tmp < (1ULL << 31)); GET_V(nut->time_base[i].den, tmp > 0 && tmp < (1ULL << 31)); if (av_gcd(nut->time_base[i].num, nut->time_base[i].den) != 1) { - av_log(s, AV_LOG_ERROR, "time base invalid\n"); + av_log(s, AV_LOG_ERROR, "invalid time base %d/%d\n", + nut->time_base[i].num, + nut->time_base[i].den); ret = AVERROR_INVALIDDATA; goto fail; } @@ -315,7 +317,8 @@ static int decode_main_header(NUTContext *nut) goto fail; } if (tmp_stream >= stream_count) { - av_log(s, AV_LOG_ERROR, "illegal stream number\n"); + av_log(s, AV_LOG_ERROR, "illegal stream number %d >= %d\n", + tmp_stream, stream_count); ret = AVERROR_INVALIDDATA; goto fail; } @@ -344,12 +347,14 @@ static int decode_main_header(NUTContext *nut) for (i = 1; i < nut->header_count; i++) { uint8_t *hdr; GET_V(nut->header_len[i], tmp > 0 && tmp < 256); - rem -= nut->header_len[i]; - if (rem < 0) { - av_log(s, AV_LOG_ERROR, "invalid elision header\n"); + if (rem < nut->header_len[i]) { + av_log(s, AV_LOG_ERROR, + "invalid elision header %d : %d > %d\n", + i, nut->header_len[i], rem); ret = AVERROR_INVALIDDATA; goto fail; } + rem -= nut->header_len[i]; hdr = av_malloc(nut->header_len[i]); if (!hdr) { ret = AVERROR(ENOMEM); |