+ if (image_width != avctx->width || image_height != avctx->height) {
+ int ret;
+ avcodec_set_dimensions(avctx, image_width, image_height);
+ s->width = avctx->width;
+ s->height = avctx->height;
+ ret = iv_alloc_frames(s);
+ if (ret < 0) {
+ s->width = s->height = 0;
+ return ret;
+ }
+ }