diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-29 00:20:29 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-29 00:20:29 +0100 |
commit | 4dcd1a3145dd93602b86a44ebc07d98ca2a30ab6 (patch) | |
tree | 694f5d2cba955bc53de20f8fb81cb54439ae5279 /libavformat/mpegtsenc.c | |
parent | 4b03d960220d15cb915c2c8f15970d2f36f25cd9 (diff) | |
parent | ac47e014bbaf5163871a8beb7522015e0bc27615 (diff) | |
download | ffmpeg-4dcd1a3145dd93602b86a44ebc07d98ca2a30ab6.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
adtsenc: Check frame size.
txd: Fix order of operations.
APIchanges: fill in some blanks
timer: fix misspelling of "decicycles"
Eliminate pointless 0/NULL initializers in AVCodec and similar declarations.
indeo3: cosmetics
md5proto: Fix order of operations.
dca: Replace oversized unused get_bits() with skip_bits_long().
Conflicts:
doc/APIchanges
libavformat/mmsh.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegtsenc.c')
-rw-r--r-- | libavformat/mpegtsenc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index f072f80d80..abdbb5d1d1 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -1006,7 +1006,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) return -1; if ((AV_RB16(pkt->data) & 0xfff0) != 0xfff0) { ADTSContext *adts = ts_st->adts; - int new_size; + int new_size, err; if (!adts) { av_log(s, AV_LOG_ERROR, "aac bitstream not in adts format " "and extradata missing\n"); @@ -1018,7 +1018,12 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) data = av_malloc(new_size); if (!data) return AVERROR(ENOMEM); - ff_adts_write_frame_header(adts, data, pkt->size, adts->pce_size); + err = ff_adts_write_frame_header(adts, data, pkt->size, + adts->pce_size); + if (err < 0) { + av_free(data); + return err; + } if (adts->pce_size) { memcpy(data+ADTS_HEADER_SIZE, adts->pce_data, adts->pce_size); adts->pce_size = 0; |