aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/isom.c
diff options
context:
space:
mode:
authorAndrew Wason <rectalogic@rectalogic.com>2011-06-15 11:09:17 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-06-15 11:09:17 +0200
commit4f4d1358ae30c2b8588f4dc6b3ef964a048004e8 (patch)
tree5747f7ffe47e8f93b78709dd8792abe23b7bfac1 /libavformat/isom.c
parentdbf23d191a808734679bd7d0c8737c082ad24a72 (diff)
downloadffmpeg-4f4d1358ae30c2b8588f4dc6b3ef964a048004e8.tar.gz
Support reading chan atoms with empty channel descriptions.
Fixes ticket 263.
Diffstat (limited to 'libavformat/isom.c')
-rw-r--r--libavformat/isom.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 45ccdd2864..dcc3b74af3 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -459,16 +459,18 @@ void ff_mov_read_chan(AVFormatContext *s, int64_t size, AVCodecContext *codec)
uint32_t layout_tag;
AVIOContext *pb = s->pb;
const MovChannelLayout *layouts = mov_channel_layout;
- if (size != 12) {
+ layout_tag = avio_rb32(pb);
+ size -= 4;
+ if (layout_tag == 0) { //< kCAFChannelLayoutTag_UseChannelDescriptions
// Channel descriptions not implemented
av_log_ask_for_sample(s, "Unimplemented container channel layout.\n");
avio_skip(pb, size);
return;
}
- layout_tag = avio_rb32(pb);
if (layout_tag == 0x10000) { //< kCAFChannelLayoutTag_UseChannelBitmap
codec->channel_layout = avio_rb32(pb);
- avio_skip(pb, 4);
+ size -= 4;
+ avio_skip(pb, size);
return;
}
while (layouts->channel_layout) {
@@ -480,7 +482,7 @@ void ff_mov_read_chan(AVFormatContext *s, int64_t size, AVCodecContext *codec)
}
if (!codec->channel_layout)
av_log(s, AV_LOG_WARNING, "Unknown container channel layout.\n");
- avio_skip(pb, 8);
+ avio_skip(pb, size);
}
void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)