Commit f58cd286 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/paf: Fix integer overflow and out of array read

Found-by: 's avatarLaurent Butti <laurentb@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c9837613
......@@ -233,10 +233,11 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
p->current_frame_block++;
}
size = p->video_size - p->frames_offset_table[p->current_frame];
if (size < 1)
if (p->frames_offset_table[p->current_frame] >= p->video_size)
return AVERROR_INVALIDDATA;
size = p->video_size - p->frames_offset_table[p->current_frame];
if (av_new_packet(pkt, size) < 0)
return AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment