rmdec: Avoid allocating huge packets
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 24 Dec 2011 20:26:52 +0000 (21:26 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Jan 2012 21:31:35 +0000 (22:31 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 66f71f3b5e2e7b6e5049bd9831c371e16aff8a53)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rmdec.c

index 5b9bfb8..7524023 100644 (file)
@@ -24,6 +24,7 @@
 #include "libavutil/dict.h"
 #include "avformat.h"
 #include "internal.h"
+#include "avio_internal.h"
 #include "riff.h"
 #include "rm.h"
 
@@ -612,6 +613,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
     }
     if(type != 1){  // not whole frame
         len2 = get_num(pb, &len);
+        len2 = ffio_limit(pb, len2);
         pos  = get_num(pb, &len);
         pic_num = avio_r8(pb); len--;
     }