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
release/0.6
Justin Ruggles 16 years ago
parent 505cc62f75
commit 5b37e2fc9a
  1. 5
      libavcodec/flacdec.c

@ -37,6 +37,7 @@
#include "libavutil/crc.h" #include "libavutil/crc.h"
#include "avcodec.h" #include "avcodec.h"
#include "internal.h"
#include "bitstream.h" #include "bitstream.h"
#include "golomb.h" #include "golomb.h"
#include "flac.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) if (s->decorrelation == LEFT_SIDE || s->decorrelation == MID_SIDE)
s->curr_bps++; 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)) { if (get_bits1(&s->gb)) {
av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n"); av_log(s->avctx, AV_LOG_ERROR, "invalid subframe padding\n");

Loading…
Cancel
Save