aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-01 22:42:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-01 22:42:41 +0200
commitb0804f37058271baed170f0a39bb0bbaa6c71047 (patch)
tree8d9c90103ee0d7508281f88f35b77a818d6c3480 /libavformat
parent77a7092d1c22fc49a26514c1e7a36d6a971707d9 (diff)
parent58decdb639e8582063807b5ddfb86dada6731f74 (diff)
downloadffmpeg-b0804f37058271baed170f0a39bb0bbaa6c71047.tar.gz
Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7: (73 commits) Update Changelog for 0.7.2 release Update RELEASE file for 0.7.2 lavf: do not set codec_tag for rawvideo fate: allow testing with libavfilter disabled fate: separate lavf-mxf_d10 test from lavf-mxf Fix memory (re)allocation in matroskadec.c, related to MSVR-11-0080. movenc: fix NULL reference in mov_write_tkhd_tag movenc: create an alternate group for each media type flvdec: Check for overflow before allocating arrays ppc: fix some pointer to integer casts ppc: fix 32-bit PIC build rv34: Check for invalid slice offsets rv34: Fix potential overreads rv34: Avoid NULL dereference on corrupted bitstream rv10: Reject slices that does not have the same type as the first one lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails oggdec: fix out of bound write in the ogg demuxer Fixed size given to init_get_bits(). smacker: fix a few off by 1 errors Check for invalid VLC value in smacker decoder. ... Conflicts: RELEASE libavcodec/avs.c libavcodec/ppc/asm.S libavcodec/rv34.c libavcodec/xan.c libavdevice/alsa-audio.h libavformat/flvdec.c libavformat/gxf.c libavformat/utils.c libswscale/x86/swscale_template.c tests/ref/lavf/mov tests/ref/lavf/mxf Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c15
-rw-r--r--libavformat/movenc.c3
2 files changed, 15 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 0451071a57..66d3e46b08 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -964,6 +964,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
uint8_t* data = *buf;
int isize = *buf_size;
uint8_t* pkt_data = NULL;
+ uint8_t* newpktdata;
int pkt_size = isize;
int result = 0;
int olen;
@@ -993,7 +994,12 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
zstream.avail_in = isize;
do {
pkt_size *= 3;
- pkt_data = av_realloc(pkt_data, pkt_size);
+ newpktdata = av_realloc(pkt_data, pkt_size);
+ if (!newpktdata) {
+ inflateEnd(&zstream);
+ goto failed;
+ }
+ pkt_data = newpktdata;
zstream.avail_out = pkt_size - zstream.total_out;
zstream.next_out = pkt_data + zstream.total_out;
if (pkt_data) {
@@ -1017,7 +1023,12 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size,
bzstream.avail_in = isize;
do {
pkt_size *= 3;
- pkt_data = av_realloc(pkt_data, pkt_size);
+ newpktdata = av_realloc(pkt_data, pkt_size);
+ if (!newpktdata) {
+ BZ2_bzDecompressEnd(&bzstream);
+ goto failed;
+ }
+ pkt_data = newpktdata;
bzstream.avail_out = pkt_size - bzstream.total_out_lo32;
bzstream.next_out = pkt_data + bzstream.total_out_lo32;
if (pkt_data) {
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 076f2e3c69..4448628eb1 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1223,7 +1223,8 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
avio_wb32(pb, 0); /* reserved */
avio_wb32(pb, 0); /* reserved */
- avio_wb32(pb, 0x0); /* reserved (Layer & Alternate group) */
+ avio_wb16(pb, 0); /* layer */
+ avio_wb16(pb, st ? st->codec->codec_type : 0); /* alternate group) */
/* Volume, only for audio */
if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
avio_wb16(pb, 0x0100);