Browse code

Remove unnecessary calls to avcodec_check_dimensions, the check is already done at a higher level.

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

Reimar Döffinger authored on 2009/10/14 05:13:28
Showing 18 changed files
... ...
@@ -159,10 +159,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
159 159
 
160 160
         c->pic.data[0] = NULL;
161 161
 
162
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
163
-        return 1;
164
-    }
165
-
166 162
         switch (avctx->bits_per_coded_sample) {
167 163
                 case 8:
168 164
                         avctx->pix_fmt = PIX_FMT_PAL8;
... ...
@@ -216,9 +216,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
216 216
 
217 217
 static av_cold int decode_init(AVCodecContext *avctx) {
218 218
     CamStudioContext *c = avctx->priv_data;
219
-    if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
220
-        return 1;
221
-    }
222 219
     switch (avctx->bits_per_coded_sample) {
223 220
         case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
224 221
         case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;
... ...
@@ -295,10 +295,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
295 295
     c->avctx = avctx;
296 296
     avctx->pix_fmt = PIX_FMT_PAL8;
297 297
 
298
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
299
-        return -1;
300
-    }
301
-
302 298
     c->dsize = avctx->width * avctx->height * 2;
303 299
     if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
304 300
         av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
... ...
@@ -108,10 +108,6 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
108 108
         return -1;
109 109
     }
110 110
 
111
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
112
-        return -1;
113
-    }
114
-
115 111
     // Needed if zlib unused or init aborted before deflateInit
116 112
     memset(&(s->zstream), 0, sizeof(z_stream));
117 113
 
... ...
@@ -458,10 +458,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
458 458
         return 1;
459 459
     }
460 460
 
461
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
462
-        return 1;
463
-    }
464
-
465 461
     /* Check codec type */
466 462
     if ((avctx->codec_id == CODEC_ID_MSZH  && avctx->extradata[7] != CODEC_MSZH) ||
467 463
         (avctx->codec_id == CODEC_ID_ZLIB  && avctx->extradata[7] != CODEC_ZLIB)) {
... ...
@@ -58,9 +58,6 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
58 58
 
59 59
     avctx->pix_fmt = PIX_FMT_PAL8;
60 60
 
61
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height))
62
-        return -1;
63
-
64 61
     s->frame.reference = 1;
65 62
     if (avctx->get_buffer(avctx, &s->frame)) {
66 63
         av_log(s->avctx, AV_LOG_ERROR, "mmvideo: get_buffer() failed\n");
... ...
@@ -135,10 +135,6 @@ static int decode_frame(AVCodecContext *avctx,
135 135
 static av_cold int decode_init(AVCodecContext *avctx){
136 136
 //    QdrawContext * const a = avctx->priv_data;
137 137
 
138
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
139
-        return 1;
140
-    }
141
-
142 138
     avctx->pix_fmt= PIX_FMT_PAL8;
143 139
 
144 140
     return 0;
... ...
@@ -939,12 +939,6 @@ static int roq_encode_init(AVCodecContext *avctx)
939 939
     if (((avctx->width)&(avctx->width-1))||((avctx->height)&(avctx->height-1)))
940 940
         av_log(avctx, AV_LOG_ERROR, "Warning: dimensions not power of two\n");
941 941
 
942
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height)) {
943
-        av_log(avctx, AV_LOG_ERROR, "Invalid dimensions (%dx%d)\n",
944
-               avctx->width, avctx->height);
945
-        return -1;
946
-    }
947
-
948 942
     enc->width = avctx->width;
949 943
     enc->height = avctx->height;
950 944
 
... ...
@@ -514,10 +514,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
514 514
 
515 515
     c->avctx = avctx;
516 516
 
517
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
518
-        return 1;
519
-    }
520
-
521 517
     avctx->pix_fmt = PIX_FMT_PAL8;
522 518
 
523 519
 
... ...
@@ -813,9 +813,6 @@ static av_cold int decode_init(AVCodecContext *avctx){
813 813
     TM2Context * const l = avctx->priv_data;
814 814
     int i;
815 815
 
816
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
817
-        return -1;
818
-    }
819 816
     if((avctx->width & 3) || (avctx->height & 3)){
820 817
         av_log(avctx, AV_LOG_ERROR, "Width and height must be multiple of 4\n");
821 818
         return -1;
... ...
@@ -141,10 +141,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
141 141
 
142 142
     c->height = avctx->height;
143 143
 
144
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
145
-        return 1;
146
-    }
147
-
148 144
     // Needed if zlib unused or init aborted before inflateInit
149 145
     memset(&(c->zstream), 0, sizeof(z_stream));
150 146
     switch(avctx->bits_per_coded_sample){
... ...
@@ -30,8 +30,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
30 30
         av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n");
31 31
         return -1;
32 32
     }
33
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
34
-        return -1;
35 33
     avctx->pix_fmt             = PIX_FMT_YUV422P16;
36 34
     avctx->bits_per_raw_sample = 10;
37 35
 
... ...
@@ -27,8 +27,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
27 27
         av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n");
28 28
         return -1;
29 29
     }
30
-    if(avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0)
31
-        return -1;
32 30
     avctx->pix_fmt = PIX_FMT_YUV422P16;
33 31
     avctx->bits_per_raw_sample= 10;
34 32
 
... ...
@@ -251,10 +251,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
251 251
     c->avctx = avctx;
252 252
     avctx->pix_fmt = PIX_FMT_PAL8;
253 253
 
254
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
255
-        return -1;
256
-    }
257
-
258 254
     c->frame      = av_malloc( avctx->width * avctx->height);
259 255
     c->prev_frame = av_malloc( avctx->width * avctx->height);
260 256
 
... ...
@@ -468,9 +468,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
468 468
     c->width = avctx->width;
469 469
     c->height = avctx->height;
470 470
 
471
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
472
-        return 1;
473
-    }
474 471
     c->bpp = avctx->bits_per_coded_sample;
475 472
     c->bpp2 = c->bpp/8;
476 473
 
... ...
@@ -74,9 +74,6 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
74 74
 
75 75
     avctx->pix_fmt = PIX_FMT_PAL8;
76 76
 
77
-    if(avcodec_check_dimensions(avctx, avctx->width, avctx->height))
78
-        return -1;
79
-
80 77
     s->buffer1_size = avctx->width * avctx->height;
81 78
     s->buffer1 = av_malloc(s->buffer1_size);
82 79
     s->buffer2_size = avctx->width * avctx->height;
... ...
@@ -602,9 +602,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
602 602
     c->width = avctx->width;
603 603
     c->height = avctx->height;
604 604
 
605
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
606
-        return 1;
607
-    }
608 605
     c->bpp = avctx->bits_per_coded_sample;
609 606
 
610 607
     // Needed if zlib unused or init aborted before inflateInit
... ...
@@ -263,10 +263,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
263 263
         return -1;
264 264
     }
265 265
 
266
-    if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) {
267
-        return -1;
268
-    }
269
-
270 266
     // Needed if zlib unused or init aborted before deflateInit
271 267
     memset(&(c->zstream), 0, sizeof(z_stream));
272 268
     c->comp_size = avctx->width * avctx->height + 1024 +