diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-08 04:59:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-08 04:59:56 +0100 |
commit | b918d6e2e63782df5244104d0b34340967ebc40c (patch) | |
tree | 5ac49ee3e7f576e401e6f62355e0a60fa61b654e /libavcodec | |
parent | d1122b7ce5f5d9bb9bcdf5efe67e76778cd4260a (diff) | |
download | ffmpeg-b918d6e2e63782df5244104d0b34340967ebc40c.tar.gz |
avcodec/vorbis: return proper error codes from ff_vorbis_len2vlc()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vorbis.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c index 6eb765d7d0..6d2ff4bbc0 100644 --- a/libavcodec/vorbis.c +++ b/libavcodec/vorbis.c @@ -71,7 +71,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) codes[p] = 0; if (bits[p] > 32) - return 1; + return AVERROR_INVALIDDATA; for (i = 0; i < bits[p]; ++i) exit_at_level[i+1] = 1 << i; @@ -87,7 +87,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) for (; p < num; ++p) { if (bits[p] > 32) - return 1; + return AVERROR_INVALIDDATA; if (bits[p] == 0) continue; // find corresponding exit(node which the tree can grow further from) @@ -95,7 +95,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) if (exit_at_level[i]) break; if (!i) // overspecified tree - return 1; + return AVERROR_INVALIDDATA; code = exit_at_level[i]; exit_at_level[i] = 0; // construct code (append 0s to end) and introduce new exits @@ -116,7 +116,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) //no exits should be left (underspecified tree - ie. unused valid vlcs - not allowed by SPEC) for (p = 1; p < 33; p++) if (exit_at_level[p]) - return 1; + return AVERROR_INVALIDDATA; return 0; } |