check forw_ptr CRC
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 9 Aug 2007 12:51:08 +0000 (12:51 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 9 Aug 2007 12:51:08 +0000 (12:51 +0000)
Originally committed as revision 10017 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/nutdec.c

index 60ae789ed844bdf42b4a20ce5b4c8fe1b8bd6def..1ef7bcd73b7f26e9690909281523709aeb2c11e0 100644 (file)
@@ -103,9 +103,12 @@ static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_ch
     int64_t size;
 //    start= url_ftell(bc) - 8;
 
+    init_checksum(bc, av_crc04C11DB7_update, 0);
     size= get_v(bc);
     if(size > 4096)
-        get_be32(bc); //FIXME check this
+        get_be32(bc);
+    if(get_checksum(bc) && size > 4096)
+        return -1;
 
     init_checksum(bc, calculate_checksum ? av_crc04C11DB7_update : NULL, 0);