[SCM] libav/experimental: Check for packet_length 0, it is already treated as invalid by the padding check, but that resulted in a confusing/wrong error message.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:48:39 UTC 2013


The following commit has been merged in the experimental branch:
commit 96f0731a26cd417f4dc113fe7324c276e60a99bd
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date:   Mon Jul 6 17:08:32 2009 +0000

    Check for packet_length 0, it is already treated as invalid by the padding check,
    but that resulted in a confusing/wrong error message.
    
    Originally committed as revision 19361 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 373be28..9f445ec 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -633,7 +633,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
     DO_2BITS(asf->packet_flags >> 3, padsize, 0); // padding length
 
     //the following checks prevent overflows and infinite loops
-    if(packet_length >= (1U<<29)){
+    if(!packet_length || packet_length >= (1U<<29)){
         av_log(s, AV_LOG_ERROR, "invalid packet_length %d at:%"PRId64"\n", packet_length, url_ftell(pb));
         return -1;
     }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list