uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
p_pic = av_mallocz(sizeof(AVPicture));
+ if (!p_pic)
+ return NULL;
avpicture_alloc(p_pic, avctx->pix_fmt, y_width, y_height);
p_frame = schro_frame_new();
/* Decoder needs a frame - create one and push it in. */
frame = ff_create_schro_frame(avctx,
p_schro_params->frame_format);
+ if (!frame)
+ return AVERROR(ENOMEM);
schro_decoder_add_output_picture(decoder, frame);
break;
} else {
/* Allocate frame data to schro input buffer. */
SchroFrame *in_frame = libschroedinger_frame_from_data(avctx, frame);
+ if (!in_frame)
+ return AVERROR(ENOMEM);
/* Load next frame. */
schro_encoder_push_frame(encoder, in_frame);
}
/* Create output frame. */
p_frame_output = av_mallocz(sizeof(FFSchroEncodedFrame));
+ if (!p_frame_output)
+ return AVERROR(ENOMEM);
/* Set output data. */
p_frame_output->size = p_schro_params->enc_buf_size;
p_frame_output->p_encbuf = p_schro_params->enc_buf;