Commit 2b408d25 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/012v: Check dimensions more completely

Fixes division by 0
Found-by: 's avatarThomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d3b25383)
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8d853dc3
...@@ -45,8 +45,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data, ...@@ -45,8 +45,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
const uint8_t *line_end, *src = avpkt->data; const uint8_t *line_end, *src = avpkt->data;
int stride = avctx->width * 8 / 3; int stride = avctx->width * 8 / 3;
if (width == 1) { if (width <= 1 || avctx->height <= 0) {
av_log(avctx, AV_LOG_ERROR, "Width 1 not supported.\n"); av_log(avctx, AV_LOG_ERROR, "Dimensions %dx%d not supported.\n", width, avctx->height);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment