mirror of https://git.ffmpeg.org/ffmpeg.git
electronicarts: check size before reading duration out of a chunk.
Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
461ecea068
commit
fb1ea777b3
|
@ -545,10 +545,12 @@ static int ea_read_packet(AVFormatContext *s,
|
|||
case AV_CODEC_ID_ADPCM_EA_R1:
|
||||
case AV_CODEC_ID_ADPCM_EA_R2:
|
||||
case AV_CODEC_ID_ADPCM_IMA_EA_EACS:
|
||||
pkt->duration = AV_RL32(pkt->data);
|
||||
if (pkt->size >= 4)
|
||||
pkt->duration = AV_RL32(pkt->data);
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_EA_R3:
|
||||
pkt->duration = AV_RB32(pkt->data);
|
||||
if (pkt->size >= 4)
|
||||
pkt->duration = AV_RB32(pkt->data);
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_IMA_EA_SEAD:
|
||||
pkt->duration = ret * 2 / ea->num_channels;
|
||||
|
|
Loading…
Reference in New Issue