Browse Source

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

Found-by:  Laurent Butti <laurentb@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 12 years ago
parent
commit
f58cd2867a
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      libavformat/paf.c

+ 3
- 2
libavformat/paf.c View File

@@ -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);



Loading…
Cancel
Save