aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2012-12-22 01:21:09 -0500
committerReinhard Tartler <siretart@tauware.de>2013-01-12 19:34:10 +0100
commita39c6bf1b878f6667697225299707ef08a9482c8 (patch)
treeec72a0ee227868d2c2b81870a8070188673e44cc
parent884a9b0d298acfba29c01690e27419ab646fa51a (diff)
downloadffmpeg-a39c6bf1b878f6667697225299707ef08a9482c8.tar.gz
alacdec: do not be too strict about the extradata size
Sometimes the extradata has duplicate atoms, but that shouldn't prevent decoding. Just ensure that it is at least 36 bytes as a sanity check. CC: libav-stable@libav.org (cherry picked from commit 68a04b0ccee66f57516e129dd3ec457fd50b4bec) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/alac.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 4ea3f7ee84..37e957eed5 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -664,10 +664,9 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
alac->numchannels = alac->avctx->channels;
/* initialize from the extradata */
- if (alac->avctx->extradata_size != ALAC_EXTRADATA_SIZE) {
- av_log(avctx, AV_LOG_ERROR, "alac: expected %d extradata bytes\n",
- ALAC_EXTRADATA_SIZE);
- return -1;
+ if (alac->avctx->extradata_size < ALAC_EXTRADATA_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "alac: extradata is too small\n");
+ return AVERROR_INVALIDDATA;
}
if (alac_set_info(alac)) {
av_log(avctx, AV_LOG_ERROR, "alac: set_info failed\n");