summaryrefslogtreecommitdiffstats
path: root/libavcodec/magicyuv.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-06-19 09:43:22 +0200
committerPaul B Mahol <onemda@gmail.com>2016-06-19 09:45:29 +0200
commit8a135a55b3570441b6147c94f24c71e5c81ac916 (patch)
treee2885c0c60e659876c41065dedafb2b724bd75ef /libavcodec/magicyuv.c
parent63adb3602d3b35c5d1df14cf1e477bc458f96b7b (diff)
downloadffmpeg-streaming-8a135a55b3570441b6147c94f24c71e5c81ac916.zip
ffmpeg-streaming-8a135a55b3570441b6147c94f24c71e5c81ac916.tar.gz
avcodec/magicyuv: check dimensions
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/magicyuv.c')
-rw-r--r--libavcodec/magicyuv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c
index cd703e7..ce0ea9b 100644
--- a/libavcodec/magicyuv.c
+++ b/libavcodec/magicyuv.c
@@ -309,8 +309,9 @@ static int decode_frame(AVCodecContext *avctx,
s->interlaced = !!(bytestream2_get_byte(&gb) & 2);
bytestream2_skip(&gb, 3);
- avctx->coded_width = bytestream2_get_le32(&gb);
- avctx->coded_height = bytestream2_get_le32(&gb);
+ if ((ret = ff_set_dimensions(avctx, bytestream2_get_le32(&gb), bytestream2_get_le32(&gb))) < 0)
+ return ret;
+
slice_width = bytestream2_get_le32(&gb);
if (slice_width != avctx->coded_width) {
avpriv_request_sample(avctx, "unsupported slice width: %d", slice_width);
OpenPOWER on IntegriCloud