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 7ee191cab0
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavformat/dv.c
This commit is contained in:

committed by
Sean McGovern

parent
5473d23ece
commit
b0ca5fef09
@@ -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
|
* 3. Audio is always returned as 16bit linear samples: 12bit nonlinear samples
|
||||||
* are converted into 16bit linear ones.
|
* 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)
|
const DVprofile *sys)
|
||||||
{
|
{
|
||||||
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
|
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)
|
uint8_t* buf, int buf_size)
|
||||||
{
|
{
|
||||||
int size, i;
|
int size, i;
|
||||||
uint8_t *ppcm[4] = {0};
|
uint8_t *ppcm[5] = { 0 };
|
||||||
|
|
||||||
if (buf_size < DV_PROFILE_BYTES ||
|
if (buf_size < DV_PROFILE_BYTES ||
|
||||||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
|
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
|
||||||
|
Reference in New Issue
Block a user