[FFmpeg-cvslog] r25430 - trunk/libavformat/cafdec.c
pross
subversion
Sun Oct 10 02:50:37 CEST 2010
Author: pross
Date: Sun Oct 10 02:50:37 2010
New Revision: 25430
Log:
cafdec: Handle ALAC extradata.
This fixes roundup issue 2284.
Modified:
trunk/libavformat/cafdec.c
Modified: trunk/libavformat/cafdec.c
==============================================================================
--- trunk/libavformat/cafdec.c Sun Oct 10 02:39:42 2010 (r25429)
+++ trunk/libavformat/cafdec.c Sun Oct 10 02:50:37 2010 (r25430)
@@ -115,6 +115,21 @@ static int read_kuki_chunk(AVFormatConte
return AVERROR_INVALIDDATA;
}
url_fskip(pb, skip);
+ } else if (st->codec->codec_id == CODEC_ID_ALAC) {
+#define ALAC_PREAMBLE 12
+#define ALAC_HEADER 36
+ if (size < ALAC_PREAMBLE + ALAC_HEADER) {
+ av_log(s, AV_LOG_ERROR, "invalid ALAC magic cookie\n");
+ url_fskip(pb, size);
+ return AVERROR_INVALIDDATA;
+ }
+ url_fskip(pb, ALAC_PREAMBLE);
+ st->codec->extradata = av_mallocz(ALAC_HEADER + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!st->codec->extradata)
+ return AVERROR(ENOMEM);
+ get_buffer(pb, st->codec->extradata, ALAC_HEADER);
+ st->codec->extradata_size = ALAC_HEADER;
+ url_fskip(pb, size - ALAC_PREAMBLE - ALAC_HEADER);
} else {
st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
More information about the ffmpeg-cvslog
mailing list