diff options
author | Michael Niedermayer <[email protected]> | 2015-03-10 20:21:14 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2015-03-10 20:30:25 +0100 |
commit | 9f650fb5fb3270df6ef570a919b988a0a97a2e1c (patch) | |
tree | d553194cd59afe6ac1bb43b65b2e5d0ec1e1beef | |
parent | 9e835572f80b6ab82a07206ac302637039e671da (diff) |
avcodec/012v: Check dimensions more completely
Fixes division by 0
Found-by: Thomas Lindroth <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit d3b25383daffac154846daeb4e4fb46569e728db)
Conflicts:
libavcodec/012v.c
-rw-r--r-- | libavcodec/012v.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/012v.c b/libavcodec/012v.c index 6f4533b14c..8151e2a330 100644 --- a/libavcodec/012v.c +++ b/libavcodec/012v.c @@ -54,8 +54,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data, if (pic->data[0]) avctx->release_buffer(avctx, pic); - if (width == 1) { - av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n"); + if (width <= 1 || avctx->height <= 0) { + av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height); return AVERROR_INVALIDDATA; } if (avpkt->size < avctx->height * stride) { |