comparison iff.c @ 11699:83b49b0997e8 libavcodec

Ensure that width and height are > 0. avcodec_open() itself only checks that they are >= 0. Patch by Sebastian Vater <cdgs basty googlemail com>.
author rbultje
date Mon, 10 May 2010 17:00:56 +0000
parents 3ec57be57312
children 6bdec2a0e7e1
comparison
equal deleted inserted replaced
11698:9a4c9c165b3b 11699:83b49b0997e8
113 avctx->pix_fmt = PIX_FMT_BGR32; 113 avctx->pix_fmt = PIX_FMT_BGR32;
114 } else { 114 } else {
115 return AVERROR_INVALIDDATA; 115 return AVERROR_INVALIDDATA;
116 } 116 }
117 117
118 if ((err = avcodec_check_dimensions(avctx, avctx->width, avctx->height)))
119 return err;
118 s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary 120 s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
119 s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE); 121 s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
120 if (!s->planebuf) 122 if (!s->planebuf)
121 return AVERROR(ENOMEM); 123 return AVERROR(ENOMEM);
122 124