summaryrefslogtreecommitdiff
path: root/libavcodec/speedhq.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/speedhq.c')
-rw-r--r--libavcodec/speedhq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index a3b0bc4649..27aab11903 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -426,6 +426,8 @@ static int speedhq_decode_frame(AVCodecContext *avctx,
if (buf_size < 4 || avctx->width < 8 || avctx->width % 8 != 0)
return AVERROR_INVALIDDATA;
+ if (buf_size < avctx->width*avctx->height / 64 / 4)
+ return AVERROR_INVALIDDATA;
quality = buf[0];
if (quality >= 100) {