diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-12-22 01:21:09 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-12-22 12:18:41 -0500 |
commit | 68a04b0ccee66f57516e129dd3ec457fd50b4bec (patch) | |
tree | 57228d51b0e022fc066c5d169ae7bb3bcb6d3d06 /libavcodec/alac.c | |
parent | aef5150719f03ce87e67c17d2006e24d8961aa17 (diff) | |
download | ffmpeg-68a04b0ccee66f57516e129dd3ec457fd50b4bec.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
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r-- | libavcodec/alac.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 22882a56c0..1a3f769513 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -521,10 +521,9 @@ static av_cold int alac_decode_init(AVCodecContext * avctx) alac->avctx = avctx; /* 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"); |