提交 3048af83 编写于 作者: R Roberto Togni

Use avcodec_check_dimensions instead of custom hack

Originally committed as revision 3836 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 a9c3ff5b
...@@ -160,8 +160,7 @@ static int decode_init(AVCodecContext *avctx) ...@@ -160,8 +160,7 @@ static int decode_init(AVCodecContext *avctx)
c->pic.data[0] = NULL; c->pic.data[0] = NULL;
// FIXME: find a better way to prevent integer overflow if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
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); av_log(avctx, AV_LOG_ERROR, "Bad image size (w = %d, h = %d).\n", avctx->width, avctx->height);
return 1; return 1;
} }
......
...@@ -640,9 +640,7 @@ static int decode_init(AVCodecContext *avctx) ...@@ -640,9 +640,7 @@ static int decode_init(AVCodecContext *avctx)
return 1; return 1;
} }
// FIXME: find a better way to prevent integer overflow if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
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);
return 1; return 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册