aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-09 08:44:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-09 09:10:20 +0200
commitbf312714786a4018e9bf1c7f4c5444d906ae0a37 (patch)
tree695ec5ca8bed836a9e9fcc7a22f3c0b9b901f517 /libavformat
parent8715ca0b82c1a1cc2ec9998acca990bbe63d4a34 (diff)
parent4d073ddac95d789f23c3ee6f7b5348599b39f047 (diff)
downloadffmpeg-bf312714786a4018e9bf1c7f4c5444d906ae0a37.tar.gz
Merge remote-tracking branch 'qatar/release/9' into release/1.1
* qatar/release/9: Update Changelog Prepare for 9.9 RELEASE lavf: fix the comparison in an overflow check dv: Add a guard to not overread the ppcm array nuv: check ff_rtjpeg_decode_frame_yuv420 return value Conflicts: Changelog RELEASE libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dv.c4
-rw-r--r--libavformat/utils.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index a04735ac25..cf513a83b2 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -113,7 +113,7 @@ static const int dv_audio_frequency[3] = {
* 3. Audio is always returned as 16bit linear samples: 12bit nonlinear samples
* are converted into 16bit linear ones.
*/
-static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
+static int dv_extract_audio(uint8_t *frame, uint8_t **ppcm,
const DVprofile *sys)
{
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
@@ -358,7 +358,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t* buf, int buf_size, int64_t pos)
{
int size, i;
- uint8_t *ppcm[4] = {0};
+ uint8_t *ppcm[5] = { 0 };
if (buf_size < DV_PROFILE_BYTES ||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 9619d95f5e..1d9130fd7c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2258,15 +2258,18 @@ static void estimate_timings_from_bit_rate(AVFormatContext *ic)
/* if bit_rate is already set, we believe it */
if (ic->bit_rate <= 0) {
- int64_t bit_rate = 0;
+ int bit_rate = 0;
for(i=0;i<ic->nb_streams;i++) {
st = ic->streams[i];
if (st->codec->bit_rate > 0) {
+ if (INT_MAX - st->codec->bit_rate < bit_rate) {
+ bit_rate = 0;
+ break;
+ }
bit_rate += st->codec->bit_rate;
}
}
- if (bit_rate <= INT_MAX)
- ic->bit_rate = bit_rate;
+ ic->bit_rate = bit_rate;
}
/* if duration is already set, we believe it */