if (!avctx->width || !avctx->height)
return AVERROR_INVALIDDATA;
- avcodec_get_frame_defaults(&s->picture);
-
- ff_dsputil_init(&s->dsp, avctx);
-
s->width = avctx->width;
s->height = avctx->height;
int i;
f->slice_count = f->num_h_slices * f->num_v_slices;
+ if (f->slice_count <= 0) {
+ av_log(f->avctx, AV_LOG_ERROR, "Invalid number of slices\n");
+ return AVERROR(EINVAL);
+ }
for (i = 0; i < f->slice_count; i++) {
FFV1Context *fs = av_mallocz(sizeof(*fs));
FFV1Context *s = avctx->priv_data;
int i, j;
- av_frame_unref(&s->last_picture);
-
for (j = 0; j < s->slice_count; j++) {
FFV1Context *fs = s->slice_context[j];
for (i = 0; i < s->plane_count; i++) {