forked from FFmpeg/FFmpeg
avutil/hwcontext: verify hw_frames_ctx in transfer_data_alloc
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
parent
0ff18a7d6d
commit
b7a3f16957
1 changed files with 5 additions and 1 deletions
|
@ -397,10 +397,14 @@ int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ref,
|
|||
|
||||
static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags)
|
||||
{
|
||||
AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data;
|
||||
AVHWFramesContext *ctx;
|
||||
AVFrame *frame_tmp;
|
||||
int ret = 0;
|
||||
|
||||
if (!src->hw_frames_ctx)
|
||||
return AVERROR(EINVAL);
|
||||
ctx = (AVHWFramesContext*)src->hw_frames_ctx->data;
|
||||
|
||||
frame_tmp = av_frame_alloc();
|
||||
if (!frame_tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
|
|
Loading…
Add table
Reference in a new issue