10l set AVPacket.size to the true size of the returned data instead of
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 31 Dec 2008 02:47:54 +0000 (02:47 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 31 Dec 2008 02:47:54 +0000 (02:47 +0000)
the (larger) allocated size. (prevents segfaults due to later failures
from 900MB-sized packets, yes fuzzed file not a valid one)

Originally committed as revision 16404 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/rmdec.c

index 469b0f5..f6e88d1 100644 (file)
@@ -551,7 +551,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, ByteIOContext *pb,
         if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin
             memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices,
                 vst->videobufpos - 1 - 8*vst->slices);
-        pkt->size += 8*(vst->cur_slice - vst->slices);
+        pkt->size = vst->videobufpos + 8*(vst->cur_slice - vst->slices);
         pkt->pts = AV_NOPTS_VALUE;
         pkt->pos = vst->pktpos;
         return 0;