uv_width = y_width >> (SCHRO_FRAME_FORMAT_H_SHIFT(schro_frame_fmt));
uv_height = y_height >> (SCHRO_FRAME_FORMAT_V_SHIFT(schro_frame_fmt));
- p_pic = av_mallocz(sizeof(AVPicture));
- if (!p_pic || avpicture_alloc(p_pic, avctx->pix_fmt, y_width, y_height) < 0) {
- av_free(p_pic);
+ p_pic = av_frame_alloc();
+ if (!p_pic)
+ return NULL;
+
+ if (ff_get_buffer(avctx, p_pic, AV_GET_BUFFER_FLAG_REF) < 0) {
+ av_frame_free(&p_pic);
- av_log(avctx, AV_LOG_ERROR, "Unable to allocate buffer\n");
return NULL;
}
#include <schroedinger/schrovideoformat.h>
#include "libavutil/attributes.h"
+#include "libavutil/avassert.h"
+ #include "libavutil/imgutils.h"
+
#include "avcodec.h"
#include "internal.h"
#include "libschroedinger.h"