summaryrefslogtreecommitdiff
path: root/libavcodec/magicyuv.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-06-02 22:40:57 +0200
committerPaul B Mahol <onemda@gmail.com>2016-06-02 22:43:51 +0200
commite8a236add82e668c3e665a4ab38c91d875047e43 (patch)
treee5ced5239851f8ed9b3651e2e21dc42ed699ba1c /libavcodec/magicyuv.c
parentcc4ab320cf0e830165a871839b6cf84536b413c8 (diff)
downloadffmpeg-e8a236add82e668c3e665a4ab38c91d875047e43.tar.gz
avcodec/magicyuv: set correct size of last slice for each plane
Fixes invalid read. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/magicyuv.c')
-rw-r--r--libavcodec/magicyuv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index d96084d2d6..cd703e7c8a 100644
--- a/libavcodec/magicyuv.c
+++ b/libavcodec/magicyuv.c
@@ -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)