This fixes Bugzilla #327:
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
... | ... |
@@ -335,6 +335,11 @@ static av_cold int decode_init(AVCodecContext *avctx) |
335 | 335 |
return AVERROR_INVALIDDATA; |
336 | 336 |
} |
337 | 337 |
|
338 |
+ if (s->avctx->sample_rate <= 0) { |
|
339 |
+ av_log(avctx, AV_LOG_ERROR, "invalid sample rate\n"); |
|
340 |
+ return AVERROR_INVALIDDATA; |
|
341 |
+ } |
|
342 |
+ |
|
338 | 343 |
s->num_channels = avctx->channels; |
339 | 344 |
|
340 | 345 |
if (s->num_channels < 0) { |