Commit 38437047 authored by michael's avatar michael

Add a few error checks to rm_assemble_video_frame()


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16399 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 404b1dbe
......@@ -498,10 +498,14 @@ static int rm_assemble_video_frame(AVFormatContext *s, ByteIOContext *pb,
seq = get_byte(pb); len--;
len2 = get_num(pb, &len);
pos = get_num(pb, &len);
if(len < 1)
return -1;
pic_num = get_byte(pb); len--;
rm->remaining_len = len;
break;
case 1: //whole frame
if(len<1)
return -1;
seq = get_byte(pb); len--;
if(av_new_packet(pkt, len + 9) < 0)
return AVERROR(EIO);
......@@ -515,6 +519,8 @@ static int rm_assemble_video_frame(AVFormatContext *s, ByteIOContext *pb,
len2 = get_num(pb, &len);
pos = get_num(pb, &len);
pic_num = get_byte(pb); len--;
if(len < len2)
return -1;
rm->remaining_len = len - len2;
if(av_new_packet(pkt, len2 + 9) < 0)
return AVERROR(EIO);
......
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