if ((ret = av_image_alloc(buf->base, buf->linesize, w, h,
s->pix_fmt, 32)) < 0) {
av_freep(&buf);
+ av_log(s, AV_LOG_ERROR, "alloc_buffer: av_image_alloc() failed\n");
return ret;
}
- /* XXX this shouldn't be needed, but some tests break without this line
- * those decoders are buggy and need to be fixed.
- * the following tests fail:
- */
- memset(buf->base[0], 128, ret);
- av_pix_fmt_get_chroma_sub_sample(s->pix_fmt,
- &h_chroma_shift, &v_chroma_shift);
-
+ avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
const int h_shift = i==0 ? 0 : h_chroma_shift;
const int v_shift = i==0 ? 0 : v_chroma_shift;
buf->base[i] = av_malloc(size[i] + 16); //FIXME 16
if (buf->base[i] == NULL)
- return -1;
+ return AVERROR(ENOMEM);
- memset(buf->base[i], 128, size[i]);
// no edge if EDGE EMU or not planar YUV
if ((s->flags & CODEC_FLAG_EMU_EDGE) || !size[2])