[FFmpeg-cvslog] avcodec/magicyuv: set correct size of last slice for each plane
Paul B Mahol
git at videolan.org
Thu Jun 2 22:44:24 CEST 2016
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jun 2 22:40:57 2016 +0200| [e8a236add82e668c3e665a4ab38c91d875047e43] | committer: Paul B Mahol
avcodec/magicyuv: set correct size of last slice for each plane
Fixes invalid read.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e8a236add82e668c3e665a4ab38c91d875047e43
---
libavcodec/magicyuv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index d96084d..cd703e7 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)
More information about the ffmpeg-cvslog
mailing list