[FFmpeg-devel] [PATCH]lavf/mkv: Only skip prores header if the packet is long enough

Carl Eugen Hoyos cehoyos at ag.or.at
Wed May 20 19:04:05 CEST 2015


Hi!

Playing around with the input parameter -r, I was able to produce 
a dos if a prores packet had size 0 and the mkv muxer looped 
forever in ebml_num_size() called from put_ebml_num().
Attached patch fixes the endloess loop here.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 7cbba0b..c4c58f4 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1575,7 +1575,7 @@ static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
     } else
         data = pkt->data;
 
-    if (codec->codec_id == AV_CODEC_ID_PRORES) {
+    if (codec->codec_id == AV_CODEC_ID_PRORES && size >= 8) {
         /* Matroska specification requires to remove the first QuickTime atom
          */
         size  -= 8;


More information about the ffmpeg-devel mailing list