avcodec/magicyuv: set correct size of last slice for each plane
authorPaul B Mahol <onemda@gmail.com>
Thu, 2 Jun 2016 20:40:57 +0000 (22:40 +0200)
committerPaul B Mahol <onemda@gmail.com>
Thu, 2 Jun 2016 20:43:51 +0000 (22:43 +0200)
Fixes invalid read.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/magicyuv.c

index d96084d..cd703e7 100644 (file)
@@ -353,7 +353,7 @@ static int decode_frame(AVCodecContext *avctx,
         }
 
         s->slices[i][j].start = offset + header_size;
-        s->slices[i][j].size  = avpkt->size - offset;
+        s->slices[i][j].size  = avpkt->size - s->slices[i][j].start;
     }
 
     if (bytestream2_get_byte(&gb) != s->planes)