aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/huffyuvdec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-06-28 11:21:54 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-11-26 01:38:17 +0100
commit31ae0693d885f4ecf4ef750055f86467bfc5fa1d (patch)
tree0f9ab21c97ed9f9d2af077bbbb5ffcbe4d7ae4fe /libavcodec/huffyuvdec.c
parent4410505b42601ed836816fc7c9f2b113bb0d1219 (diff)
downloadffmpeg-31ae0693d885f4ecf4ef750055f86467bfc5fa1d.tar.gz
huffyuvdec: validate image size
Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 9a345802edf7f430b3335f486aecdd8552f8367b) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/huffyuvdec.c')
-rw-r--r--libavcodec/huffyuvdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 3b2b0f7f59..2746595d5b 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -37,6 +37,7 @@
#include "huffyuv.h"
#include "huffyuvdsp.h"
#include "thread.h"
+#include "libavutil/imgutils.h"
#include "libavutil/pixdesc.h"
#define classic_shift_luma_table_size 42
@@ -277,6 +278,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
HYuvContext *s = avctx->priv_data;
int ret;
+ ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
+ if (ret < 0)
+ return ret;
+
ff_huffyuvdsp_init(&s->hdsp);
memset(s->vlc, 0, 4 * sizeof(VLC));