avidec: use actually read size instead of requested size
authorAnton Khirnov <anton@khirnov.net>
Fri, 28 Sep 2012 13:42:29 +0000 (15:42 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sat, 29 Sep 2012 07:27:59 +0000 (09:27 +0200)
Fixes CVE-2012-2788

libavformat/avidec.c

index b70367f..b2a06ed 100644 (file)
@@ -1116,7 +1116,7 @@ resync:
             }
             ast->frame_offset += get_duration(ast, pkt->size);
         }
-        ast->remaining -= size;
+        ast->remaining -= err;
         if(!ast->remaining){
             avi->stream_index= -1;
             ast->packet_size= 0;