lavfi/avcodec: check avfilter_copy_frame_props() return code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
304a1ed1e8
commit
a150bad406
@ -77,7 +77,10 @@ AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame
|
|||||||
frame->format);
|
frame->format);
|
||||||
if (!picref)
|
if (!picref)
|
||||||
return NULL;
|
return NULL;
|
||||||
avfilter_copy_frame_props(picref, frame);
|
if (avfilter_copy_frame_props(picref, frame) < 0) {
|
||||||
|
picref->buf->data[0] = NULL;
|
||||||
|
avfilter_unref_bufferp(&picref);
|
||||||
|
}
|
||||||
return picref;
|
return picref;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +93,10 @@ AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame
|
|||||||
av_frame_get_channel_layout(frame));
|
av_frame_get_channel_layout(frame));
|
||||||
if (!samplesref)
|
if (!samplesref)
|
||||||
return NULL;
|
return NULL;
|
||||||
avfilter_copy_frame_props(samplesref, frame);
|
if (avfilter_copy_frame_props(samplesref, frame) < 0) {
|
||||||
|
samplesref->buf->data[0] = NULL;
|
||||||
|
avfilter_unref_bufferp(&samplesref);
|
||||||
|
}
|
||||||
return samplesref;
|
return samplesref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user