diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2015-11-24 01:24:47 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-11-25 09:01:25 +0100 |
commit | 62f72b40c0b0d2cd6a2b81977287fa01d9f4ca6d (patch) | |
tree | 76321e587eec52a4042a8508fd590b28d98e5bd6 | |
parent | 2c17fb61ced2059034856a6c6cd303014aed01fe (diff) | |
download | ffmpeg-62f72b40c0b0d2cd6a2b81977287fa01d9f4ca6d.tar.gz |
nut: Provide more information on failure
-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 bf1ab7b933..e560a7e8ee 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -238,7 +238,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); return AVERROR_INVALIDDATA; } } @@ -281,7 +283,8 @@ static int decode_main_header(NUTContext *nut) return AVERROR_INVALIDDATA; } 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); return AVERROR_INVALIDDATA; } @@ -309,11 +312,13 @@ 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); return AVERROR_INVALIDDATA; } + rem -= nut->header_len[i]; hdr = av_malloc(nut->header_len[i]); if (!hdr) return AVERROR(ENOMEM); |