Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-10 22:21:14 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-06-10 03:13:09 +0300
commitae14a444f282ce67bfcc876c678e60e37964b36c (patch)
tree52c16827d18da9f9a670c41c47d3e0530ce5b118
parentb13cba308253cb76c500c0425f7569f4a43131b1 (diff)
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> (cherry picked from commit d3b25383daffac154846daeb4e4fb46569e728db) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/012v.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/012v.c b/libavcodec/012v.c
index 58e3cd6fbd..38b1bb5f62 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;
}
if (avpkt->size < avctx->height * stride) {