diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-10 14:20:58 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-10 14:21:03 +0400 |
commit | 452f6329037934faca55c33856ac15f9d9204b87 (patch) | |
tree | 74c0968a082718399fb027ac9beb38c7937764b3 /libavformat/au.c | |
parent | be894d6caeafdd6826cbc0f46030eab7c82c7cfc (diff) | |
parent | af68a2baae6761044cbed95575e8bcfebf55c6f1 (diff) |
Merge commit 'af68a2baae6761044cbed95575e8bcfebf55c6f1'
* commit 'af68a2baae6761044cbed95575e8bcfebf55c6f1':
au: use %u when printing id and channels since they are unsigned
au: validate sample rate
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/au.c')
-rw-r--r-- | libavformat/au.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/au.c b/libavformat/au.c index e4245a1de1..269a508bcc 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -100,7 +100,7 @@ static int au_read_header(AVFormatContext *s) codec = ff_codec_get_id(codec_au_tags, id); if (codec == AV_CODEC_ID_NONE) { - av_log_ask_for_sample(s, "unknown or unsupported codec tag: %d\n", id); + av_log_ask_for_sample(s, "unknown or unsupported codec tag: %u\n", id); return AVERROR_PATCHWELCOME; } @@ -111,7 +111,12 @@ static int au_read_header(AVFormatContext *s) } if (channels == 0 || channels >= INT_MAX / (BLOCK_SIZE * bps >> 3)) { - av_log(s, AV_LOG_ERROR, "Invalid number of channels %d\n", channels); + av_log(s, AV_LOG_ERROR, "Invalid number of channels %u\n", channels); + return AVERROR_INVALIDDATA; + } + + if (rate == 0 || rate > INT_MAX) { + av_log(s, AV_LOG_ERROR, "Invalid sample rate: %u\n", rate); return AVERROR_INVALIDDATA; } |