changeset 10397:d7ed9dcc78e3 libavcodec

Remove unnecessary calls to avcodec_check_dimensions, the check is already done at a higher level.
author reimar
date Tue, 13 Oct 2009 20:13:28 +0000
parents 2bb3882075b6
children 11b685acd280
files 8bps.c cscd.c dxa.c flashsvenc.c lcldec.c mmvideo.c qdrw.c roqvideoenc.c smacker.c truemotion2.c tscc.c v210dec.c v210x.c vb.c vmnc.c xan.c zmbv.c zmbvenc.c
diffstat 18 files changed, 0 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/8bps.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/8bps.c	Tue Oct 13 20:13:28 2009 +0000
@@ -159,10 +159,6 @@
 
         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;
--- a/cscd.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/cscd.c	Tue Oct 13 20:13:28 2009 +0000
@@ -216,9 +216,6 @@
 
 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;
--- a/dxa.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/dxa.c	Tue Oct 13 20:13:28 2009 +0000
@@ -295,10 +295,6 @@
     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");
--- a/flashsvenc.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/flashsvenc.c	Tue Oct 13 20:13:28 2009 +0000
@@ -108,10 +108,6 @@
         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));
 
--- a/lcldec.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/lcldec.c	Tue Oct 13 20:13:28 2009 +0000
@@ -458,10 +458,6 @@
         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)) {
--- a/mmvideo.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/mmvideo.c	Tue Oct 13 20:13:28 2009 +0000
@@ -58,9 +58,6 @@
 
     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");
--- a/qdrw.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/qdrw.c	Tue Oct 13 20:13:28 2009 +0000
@@ -135,10 +135,6 @@
 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;
--- a/roqvideoenc.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/roqvideoenc.c	Tue Oct 13 20:13:28 2009 +0000
@@ -939,12 +939,6 @@
     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;
 
--- a/smacker.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/smacker.c	Tue Oct 13 20:13:28 2009 +0000
@@ -514,10 +514,6 @@
 
     c->avctx = avctx;
 
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
-        return 1;
-    }
-
     avctx->pix_fmt = PIX_FMT_PAL8;
 
 
--- a/truemotion2.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/truemotion2.c	Tue Oct 13 20:13:28 2009 +0000
@@ -813,9 +813,6 @@
     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;
--- a/tscc.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/tscc.c	Tue Oct 13 20:13:28 2009 +0000
@@ -141,10 +141,6 @@
 
     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){
--- a/v210dec.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/v210dec.c	Tue Oct 13 20:13:28 2009 +0000
@@ -30,8 +30,6 @@
         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;
 
--- a/v210x.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/v210x.c	Tue Oct 13 20:13:28 2009 +0000
@@ -27,8 +27,6 @@
         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;
 
--- a/vb.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/vb.c	Tue Oct 13 20:13:28 2009 +0000
@@ -251,10 +251,6 @@
     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);
 
--- a/vmnc.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/vmnc.c	Tue Oct 13 20:13:28 2009 +0000
@@ -468,9 +468,6 @@
     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;
 
--- a/xan.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/xan.c	Tue Oct 13 20:13:28 2009 +0000
@@ -74,9 +74,6 @@
 
     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;
--- a/zmbv.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/zmbv.c	Tue Oct 13 20:13:28 2009 +0000
@@ -602,9 +602,6 @@
     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
--- a/zmbvenc.c	Tue Oct 13 18:31:22 2009 +0000
+++ b/zmbvenc.c	Tue Oct 13 20:13:28 2009 +0000
@@ -263,10 +263,6 @@
         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 +