Browse Source

return error if frame_offset is negative, prevent segfault

Originally committed as revision 13420 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Baptiste Coudurier 18 years ago
parent
commit
eea2f032ad
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/ffmdec.c

+ 1
- 1
libavformat/ffmdec.c View File

@@ -104,7 +104,7 @@ static int ffm_read_data(AVFormatContext *s,
frame_offset = get_be16(pb);
get_buffer(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE);
ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
if (ffm->packet_end < ffm->packet)
if (ffm->packet_end < ffm->packet || frame_offset < 0)
return -1;
/* if first packet or resynchronization packet, we must
handle it specifically */


Loading…
Cancel
Save