Commit 10c5b29d authored by rtognimp's avatar rtognimp

Use avcodec_check_dimensions instead of custom hack


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3836 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2a0ce5b5
......@@ -160,8 +160,7 @@ static int decode_init(AVCodecContext *avctx)
c->pic.data[0] = NULL;
// FIXME: find a better way to prevent integer overflow
if (((unsigned int)avctx->width > 32000) || ((unsigned int)avctx->height > 32000)) {
if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
av_log(avctx, AV_LOG_ERROR, "Bad image size (w = %d, h = %d).\n", avctx->width, avctx->height);
return 1;
}
......
......@@ -640,9 +640,7 @@ static int decode_init(AVCodecContext *avctx)
return 1;
}
// FIXME: find a better way to prevent integer overflow
if (((unsigned int)avctx->width > 32000) || ((unsigned int)avctx->height > 32000)) {
av_log(avctx, AV_LOG_ERROR, "Bad image size (w = %d, h = %d).\n", avctx->width, avctx->height);
if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
return 1;
}
......
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