Browse Source

Use avcodec_check_dimensions instead of custom hack

Originally committed as revision 3836 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Roberto Togni 21 years ago
parent
commit
3048af8350
2 changed files with 2 additions and 5 deletions
  1. +1
    -2
      libavcodec/8bps.c
  2. +1
    -3
      libavcodec/lcl.c

+ 1
- 2
libavcodec/8bps.c View File

@@ -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;
}


+ 1
- 3
libavcodec/lcl.c View File

@@ -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;
}



Loading…
Cancel
Save