summaryrefslogtreecommitdiffstats
path: root/libavcodec/012v.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-10 20:21:14 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-10 20:21:14 +0100
commitd3b25383daffac154846daeb4e4fb46569e728db (patch)
tree8a4ea90386b6f22b8818f6570a1e1aa42e1356e6 /libavcodec/012v.c
parentc8372f8001197774ba94412a6cf761417fa481ea (diff)
downloadffmpeg-streaming-d3b25383daffac154846daeb4e4fb46569e728db.zip
ffmpeg-streaming-d3b25383daffac154846daeb4e4fb46569e728db.tar.gz
avcodec/012v: Check dimensions more completely
Fixes division by 0 Found-by: Thomas Lindroth <thomas.lindroth@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/012v.c')
-rw-r--r--libavcodec/012v.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/012v.c b/libavcodec/012v.c
index c2b6a35..7526e8f 100644
--- a/libavcodec/012v.c
+++ b/libavcodec/012v.c
@@ -45,8 +45,8 @@ static int zero12v_decode_frame(AVCodecContext *avctx, void *data,
const uint8_t *line_end, *src = avpkt->data;
int stride = avctx->width * 8 / 3;
- 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;
}
OpenPOWER on IntegriCloud