diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 04:45:45 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 04:45:45 +0000 |
commit | 5b37e2fc9ad85b8fcec376b1aec439abedfb4432 (patch) | |
tree | 8cc73b380efc40ac449d5397769c8c682f3a42d0 /libavcodec/flacdec.c | |
parent | 505cc62f75c6a0b620eb8bf41fc6f72fba173bc9 (diff) | |
download | ffmpeg-streaming-5b37e2fc9ad85b8fcec376b1aec439abedfb4432.zip ffmpeg-streaming-5b37e2fc9ad85b8fcec376b1aec439abedfb4432.tar.gz |
flacdec: Avoid trying to read 33 bits. This occurs when the source
is 32 bits-per-sample and channel decorrelation is used. Such files
are valid, but not supported currently.
Originally committed as revision 17743 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flacdec.c')
-rw-r--r-- | libavcodec/flacdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 04cb54d..8c73434 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -37,6 +37,7 @@ #include "libavutil/crc.h" #include "avcodec.h" +#include "internal.h" #include "bitstream.h" #include "golomb.h" #include "flac.h" @@ -429,6 +430,10 @@ static inline int decode_subframe(FLACContext *s, int channel) if (s->decorrelation == LEFT_SIDE || s->decorrelation == MID_SIDE) s->curr_bps++; } + if (s->curr_bps > 32) { + ff_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0); + return -1; + } if (get_bits1(&s->gb)) { av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n"); |