Mercurial > libavformat.hg
comparison mov.c @ 6491:b7f807b4cd88 libavformat tip
In mov demuxer, check that nb_streams is valid before using it in read_dac3
author | bcoudurier |
---|---|
date | Tue, 28 Sep 2010 00:33:21 +0000 |
parents | bae1afdd961a |
children |
comparison
equal
deleted
inserted
replaced
6490:e1716e7b179f | 6491:b7f807b4cd88 |
---|---|
565 static int mov_read_dac3(MOVContext *c, ByteIOContext *pb, MOVAtom atom) | 565 static int mov_read_dac3(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
566 { | 566 { |
567 AVStream *st; | 567 AVStream *st; |
568 int ac3info, acmod, lfeon; | 568 int ac3info, acmod, lfeon; |
569 | 569 |
570 if (c->fc->nb_streams < 1) | |
571 return 0; | |
570 st = c->fc->streams[c->fc->nb_streams-1]; | 572 st = c->fc->streams[c->fc->nb_streams-1]; |
571 | 573 |
572 ac3info = get_be24(pb); | 574 ac3info = get_be24(pb); |
573 acmod = (ac3info >> 11) & 0x7; | 575 acmod = (ac3info >> 11) & 0x7; |
574 lfeon = (ac3info >> 10) & 0x1; | 576 lfeon = (ac3info >> 10) & 0x1; |