]> git.sesse.net Git - ffmpeg/commitdiff
Remove unnecessary calls to avcodec_check_dimensions, the check is already
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 13 Oct 2009 20:13:28 +0000 (20:13 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Tue, 13 Oct 2009 20:13:28 +0000 (20:13 +0000)
done at a higher level.

Originally committed as revision 20229 to svn://svn.ffmpeg.org/ffmpeg/trunk

18 files changed:
libavcodec/8bps.c
libavcodec/cscd.c
libavcodec/dxa.c
libavcodec/flashsvenc.c
libavcodec/lcldec.c
libavcodec/mmvideo.c
libavcodec/qdrw.c
libavcodec/roqvideoenc.c
libavcodec/smacker.c
libavcodec/truemotion2.c
libavcodec/tscc.c
libavcodec/v210dec.c
libavcodec/v210x.c
libavcodec/vb.c
libavcodec/vmnc.c
libavcodec/xan.c
libavcodec/zmbv.c
libavcodec/zmbvenc.c

index 28187b03601acf91e9469b577025421402abb2d1..fb5ef7173266b6d141717518962691c62f1fff18 100644 (file)
@@ -159,10 +159,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
         c->pic.data[0] = NULL;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
         switch (avctx->bits_per_coded_sample) {
                 case 8:
                         avctx->pix_fmt = PIX_FMT_PAL8;
index e58cf7861d7ca4f0b79a2d52307a7eca28fe268c..45edca382c125386684713723b64b663494a87c2 100644 (file)
@@ -216,9 +216,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
 
 static av_cold int decode_init(AVCodecContext *avctx) {
     CamStudioContext *c = avctx->priv_data;
-    if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
-        return 1;
-    }
     switch (avctx->bits_per_coded_sample) {
         case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
         case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;
index 69aed3c89e2ff9c40d7edb3fabae3908a53f0821..c06ab85cc79b293bee55e7740c7928a36ff7d5bb 100644 (file)
@@ -295,10 +295,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
     c->avctx = avctx;
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     c->dsize = avctx->width * avctx->height * 2;
     if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
         av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
index 3512b026989af0d8105a82175e19488130e6696c..4d2b47979f220307c90c5be954bee30c52c38e48 100644 (file)
@@ -108,10 +108,6 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
         return -1;
     }
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     // Needed if zlib unused or init aborted before deflateInit
     memset(&(s->zstream), 0, sizeof(z_stream));
 
index 15c686e0a97227d4d6a9d5b813ed8ee984f7f484..d4fe65ccebb4d5bfc9abc4c5150e6cdf1e400e58 100644 (file)
@@ -458,10 +458,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
         return 1;
     }
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     /* Check codec type */
     if ((avctx->codec_id == CODEC_ID_MSZH  && avctx->extradata[7] != CODEC_MSZH) ||
         (avctx->codec_id == CODEC_ID_ZLIB  && avctx->extradata[7] != CODEC_ZLIB)) {
index 6dc95589c6df3a79bc80f0aa45dfc4708cda677f..596ca7aec47b0fb8067384f5bc992c4c7a2e2836 100644 (file)
@@ -58,9 +58,6 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
 
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height))
-        return -1;
-
     s->frame.reference = 1;
     if (avctx->get_buffer(avctx, &s->frame)) {
         av_log(s->avctx, AV_LOG_ERROR, "mmvideo: get_buffer() failed\n");
index 0f9609159ccfc64f41dfeefd64861b90431d31e8..cd53bfb33861c7bca787982608562b864dd5c0fd 100644 (file)
@@ -135,10 +135,6 @@ static int decode_frame(AVCodecContext *avctx,
 static av_cold int decode_init(AVCodecContext *avctx){
 //    QdrawContext * const a = avctx->priv_data;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     avctx->pix_fmt= PIX_FMT_PAL8;
 
     return 0;
index 0f74ddd6719561eb24fa6cd9a6cc21bd25c28cfc..8dc77bd414cdd8a71db6ff69f4689f71ded820e8 100644 (file)
@@ -939,12 +939,6 @@ static int roq_encode_init(AVCodecContext *avctx)
     if (((avctx->width)&(avctx->width-1))||((avctx->height)&(avctx->height-1)))
         av_log(avctx, AV_LOG_ERROR, "Warning: dimensions not power of two\n");
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height)) {
-        av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n",
-               avctx->width, avctx->height);
-        return -1;
-    }
-
     enc->width = avctx->width;
     enc->height = avctx->height;
 
index 0d39027b0b2b237414b3a40bc7da165d58e728d3..18eaebc6adb4af13b049f33969851bb2354bad1e 100644 (file)
@@ -514,10 +514,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     c->avctx = avctx;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     avctx->pix_fmt = PIX_FMT_PAL8;
 
 
index ee3d6d9212052535dde08f9a1cc9dd5329d8c17b..09c500146d95db713a089bf4fed00dc743c74d33 100644 (file)
@@ -813,9 +813,6 @@ static av_cold int decode_init(AVCodecContext *avctx){
     TM2Context * const l = avctx->priv_data;
     int i;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
     if((avctx->width & 3) || (avctx->height & 3)){
         av_log(avctx, AV_LOG_ERROR, "Width and height must be multiple of 4\n");
         return -1;
index d1a924da400bd3fad684842b29f6609028de1757..b00b5c5568dc9cce9b22c43a11fbb99b3fa306d0 100644 (file)
@@ -141,10 +141,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     c->height = avctx->height;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     // Needed if zlib unused or init aborted before inflateInit
     memset(&(c->zstream), 0, sizeof(z_stream));
     switch(avctx->bits_per_coded_sample){
index 08c954d88e53fb444ebe83b8f2ba3922583b4c1a..ceeccb634609f5117c57b40170196adf0e629b38 100644 (file)
@@ -30,8 +30,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
         return -1;
     }
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
-        return -1;
     avctx->pix_fmt             = PIX_FMT_YUV422P16;
     avctx->bits_per_raw_sample = 10;
 
index fe1b6de30ad1bf5ed7d2d6ffeb1a595f1948f506..549a157f418b990e371f43856776bb1865e00add 100644 (file)
@@ -27,8 +27,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");
         return -1;
     }
-    if(avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
-        return -1;
     avctx->pix_fmt = PIX_FMT_YUV422P16;
     avctx->bits_per_raw_sample= 10;
 
index 02efa030a5a252d7cbfe6cf893e7031c3c5447ee..551b10657ce43d2817365e13095a819a67c778ba 100644 (file)
@@ -251,10 +251,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
     c->avctx = avctx;
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     c->frame      = av_malloc( avctx->width * avctx->height);
     c->prev_frame = av_malloc( avctx->width * avctx->height);
 
index a97655a27c39ac88e8b3f2c8490b6eae1898b394..b4c07f76e46868fabea53cc3287cb33454668fb2 100644 (file)
@@ -468,9 +468,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
     c->width = avctx->width;
     c->height = avctx->height;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
     c->bpp = avctx->bits_per_coded_sample;
     c->bpp2 = c->bpp/8;
 
index 83b64ca05045d2bf6d18c3662ce43588836428a1..fcfd9c6d0c12c67feed2c0472fa305a9a30fcc3a 100644 (file)
@@ -74,9 +74,6 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
 
     avctx->pix_fmt = PIX_FMT_PAL8;
 
-    if(avcodec_check_dimensions(avctx, avctx->width, avctx->height))
-        return -1;
-
     s->buffer1_size = avctx->width * avctx->height;
     s->buffer1 = av_malloc(s->buffer1_size);
     s->buffer2_size = avctx->width * avctx->height;
index de2eb9c4c67222612c3a539b9b7ec79c512425a5..35a31c092463ed65327746e9ad29f7dbe01228a0 100644 (file)
@@ -602,9 +602,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
     c->width = avctx->width;
     c->height = avctx->height;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
     c->bpp = avctx->bits_per_coded_sample;
 
     // Needed if zlib unused or init aborted before inflateInit
index 5a1428e4a8e2b15a195f8fdbdc98e5898facb4d2..0131b5d1f3f2ca1cb89af97e0b9a3f5a02ba8616 100644 (file)
@@ -263,10 +263,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
         return -1;
     }
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return -1;
-    }
-
     // Needed if zlib unused or init aborted before deflateInit
     memset(&(c->zstream), 0, sizeof(z_stream));
     c->comp_size = avctx->width * avctx->height + 1024 +