summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/wmaprodec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 5396733dce..f8f901c224 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -338,6 +338,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->decode_flags = AV_RL16(edata_ptr+14);
channel_mask = AV_RL32(edata_ptr+2);
s->bits_per_sample = AV_RL16(edata_ptr);
+
+ if (s->bits_per_sample > 32 || s->bits_per_sample < 1) {
+ avpriv_request_sample(avctx, "bits per sample is %d", s->bits_per_sample);
+ return AVERROR_PATCHWELCOME;
+ }
+
/** dump the extradata */
for (i = 0; i < avctx->extradata_size; i++)
ff_dlog(avctx, "[%x] ", avctx->extradata[i]);