s->motion_val16[plane] = av_mallocz((s->m.mb_stride *
(block_height + 2) + 1) *
2 * sizeof(int16_t));
+ if (!s->motion_val8[plane] || !s->motion_val16[plane])
+ return AVERROR(ENOMEM);
}
s->m.mb_type = s->mb_type;
s->y_block_height * sizeof(int32_t));
s->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
+ if (!s->m.me.scratchpad || !s->m.me.map || !s->m.me.score_map ||
+ !s->mb_type || !s->dummy) {
+ svq1_encode_end(avctx);
+ return AVERROR(ENOMEM);
+ }
+
if (ARCH_PPC)
ff_svq1enc_init_ppc(s);
if (ARCH_X86)
}
if (!s->current_picture->data[0]) {
- if ((ret = ff_get_buffer(avctx, s->current_picture, 0))< 0 ||
- (ret = ff_get_buffer(avctx, s->last_picture, 0)) < 0) {
+ if ((ret = ff_get_buffer(avctx, s->current_picture, 0)) < 0) {
return ret;
}
- s->scratchbuf = av_malloc(s->current_picture->linesize[0] * 16 * 3);
+ }
+ if (!s->last_picture->data[0]) {
+ ret = ff_get_buffer(avctx, s->last_picture, 0);
+ if (ret < 0)
+ return ret;
+ }
+ if (!s->scratchbuf) {
+ s->scratchbuf = av_malloc_array(s->current_picture->linesize[0], 16 * 3);
+ if (!s->scratchbuf)
+ return AVERROR(ENOMEM);
}
FFSWAP(AVFrame*, s->current_picture, s->last_picture);