aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/aiffdec.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2015-01-05 08:44:06 +1100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-05 01:45:49 +0100
commitf1098eb97d3c15640d3473aeba97e2be22ee0d54 (patch)
tree6206a3af65a887e6aaca5d4319c466a5674590b4 /libavformat/aiffdec.c
parentce1e10aa24ccf9682ede2f08cffbb3e96ebbd299 (diff)
downloadffmpeg-f1098eb97d3c15640d3473aeba97e2be22ee0d54.tar.gz
avformat/aiffdec: only read codec tag when there is space in header
Signed-off-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/aiffdec.c')
-rw-r--r--libavformat/aiffdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 91ef2a4d10..8dbed327b6 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -116,10 +116,12 @@ static unsigned int get_aiff_header(AVFormatContext *s, int size,
size -= 18;
/* get codec id for AIFF-C */
- if (version == AIFF_C_VERSION1) {
+ if (version == AIFF_C_VERSION1 && size >= 4) {
codec->codec_tag = avio_rl32(pb);
codec->codec_id = ff_codec_get_id(ff_codec_aiff_tags, codec->codec_tag);
size -= 4;
+ } else {
+ version = AIFF;
}
if (version != AIFF_C_VERSION1 || codec->codec_id == AV_CODEC_ID_PCM_S16BE) {