diff asfdec.c @ 5094:7d589bcd9b1f libavformat

Check for packet_length 0, it is already treated as invalid by the padding check, but that resulted in a confusing/wrong error message.
author reimar
date Mon, 06 Jul 2009 17:08:32 +0000
parents 5e6156776ee2
children 44a0fab134a9
line wrap: on
line diff
--- a/asfdec.c	Sat Jul 04 08:02:01 2009 +0000
+++ b/asfdec.c	Mon Jul 06 17:08:32 2009 +0000
@@ -633,7 +633,7 @@
     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;
     }