avidec: update size when packet is shrunk
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 21:56:26 +0000 (23:56 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 13 Apr 2012 22:24:38 +0000 (00:24 +0200)
Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avidec.c

index 0067ff9..b78a3d2 100644 (file)
@@ -1125,6 +1125,7 @@ resync:
         err= av_get_packet(pb, pkt, size);
         if(err<0)
             return err;
+        size = err;
 
         if(ast->has_pal && pkt->data && pkt->size<(unsigned)INT_MAX/2){
             uint8_t *pal;