1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

dpx: include offset in the total_size calculation

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-10 17:54:00 +01:00
parent 151067bbc2
commit cb85779d45

View File

@ -199,7 +199,7 @@ static int decode_frame(AVCodecContext *avctx,
for (i=0; i<AV_NUM_DATA_POINTERS; i++)
ptr[i] = p->data[i];
if (total_size > avpkt->size) {
if (total_size + (int64_t)offset > avpkt->size) {
av_log(avctx, AV_LOG_ERROR, "Overread buffer. Invalid header?\n");
return AVERROR_INVALIDDATA;
}