diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-23 22:30:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-23 22:30:49 +0200 |
commit | 211ad5042adcf9f6e8abb9d0f1f3316331481535 (patch) | |
tree | 4fb580c154ec4f6c5900cce604ea038b19ecdd48 | |
parent | 2b06f5f8f15a4464c74405cd7da57da2d6be5d36 (diff) | |
parent | dbb534cea6b2b135485fd04cea022d08a350ac37 (diff) | |
download | ffmpeg-211ad5042adcf9f6e8abb9d0f1f3316331481535.tar.gz |
Merge remote-tracking branch 'jamrial/release/2.0' into release/2.0
* jamrial/release/2.0:
avformat/matroskadec: check out_samplerate before using it in av_rescale()
matroskadec: Improve TTA duration calculation
avformat/oggparsevorbis: fix leak of tt
avformat/oggparsevorbis: fix leak of ct
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/matroskadec.c | 4 | ||||
-rw-r--r-- | libavformat/oggparsevorbis.c | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 9a15a2b8e5..b686eeba75 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1737,8 +1737,10 @@ static int matroska_read_header(AVFormatContext *s) avio_wl16(&b, 1); avio_wl16(&b, track->audio.channels); avio_wl16(&b, track->audio.bitdepth); + if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX) + return AVERROR_INVALIDDATA; avio_wl32(&b, track->audio.out_samplerate); - avio_wl32(&b, matroska->ctx->duration * track->audio.out_samplerate); + avio_wl32(&b, av_rescale((matroska->duration * matroska->time_scale), track->audio.out_samplerate, AV_TIME_BASE * 1000)); } else if (codec_id == AV_CODEC_ID_RV10 || codec_id == AV_CODEC_ID_RV20 || codec_id == AV_CODEC_ID_RV30 || codec_id == AV_CODEC_ID_RV40) { extradata_offset = 26; diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index a21b3a92cc..ce475a4701 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -136,11 +136,15 @@ ff_vorbis_comment(AVFormatContext * as, AVDictionary **m, const uint8_t *buf, in if (!pict) { av_log(as, AV_LOG_WARNING, "out-of-memory error. Skipping cover art block.\n"); + av_freep(&tt); + av_freep(&ct); continue; } if ((ret = av_base64_decode(pict, ct, vl)) > 0) ret = ff_flac_parse_picture(as, pict, ret); av_freep(&pict); + av_freep(&tt); + av_freep(&ct); if (ret < 0) { av_log(as, AV_LOG_WARNING, "Failed to parse cover art block.\n"); continue; |