mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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
This commit is contained in:
parent
0fbb0185b9
commit
4a49ab77c6
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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){
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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 +
|
||||
|
Loading…
Reference in New Issue
Block a user