aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-08-05 22:15:24 +0200
committerSean McGovern <gseanmcg@gmail.com>2013-09-23 19:54:02 -0400
commitb0ca5fef09d1b1268ea0c8f89bf53cd38aaa85e7 (patch)
tree124ca7809414579d58eaf34ebeb6d673f1bab6af
parent5473d23ece9e42a8003fc880027fe242604ce367 (diff)
downloadffmpeg-b0ca5fef09d1b1268ea0c8f89bf53cd38aaa85e7.tar.gz
dv: Add a guard to not overread the ppcm array
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 7ee191cab0dc44700f26c5784e2adeb6a779651b) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Conflicts: libavformat/dv.c
-rw-r--r--libavformat/dv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 65d0f873dc..ac662371e2 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -102,7 +102,7 @@ static const uint8_t* dv_extract_pack(uint8_t* frame, enum dv_pack_type t)
* 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;
@@ -335,7 +335,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t* buf, int buf_size)
{
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)) ||