diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-01-05 12:04:27 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-01-10 11:47:29 +0100 |
commit | 3dc7a9f6239d909b3e66712b32380822466882af (patch) | |
tree | 161c079fde4435781cb9615b85701334ece00da5 | |
parent | 94aa70d757af6b0e0919250f9def2a819aa00358 (diff) | |
download | ffmpeg-3dc7a9f6239d909b3e66712b32380822466882af.tar.gz |
lavc/ac3dec: fail when the sample rate is unset
-rw-r--r-- | libavcodec/ac3dec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 1f2949dcfd..0b120e6140 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1716,6 +1716,11 @@ skip: avctx->bit_rate = s->bit_rate + s->prev_bit_rate; } + if (!avctx->sample_rate) { + av_log(avctx, AV_LOG_ERROR, "Could not determine the sample rate\n"); + return AVERROR_INVALIDDATA; + } + for (ch = 0; ch < EAC3_MAX_CHANNELS; ch++) extended_channel_map[ch] = ch; |