You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/nvdec: Check av_buffer_ref()
It (unfortunately) involves an allocation and can therefore fail. Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -532,8 +532,11 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
unmap_data->idx = cf->idx;
|
unmap_data->idx = cf->idx;
|
||||||
unmap_data->idx_ref = av_buffer_ref(cf->idx_ref);
|
if (!(unmap_data->idx_ref = av_buffer_ref(cf->idx_ref)) ||
|
||||||
unmap_data->decoder_ref = av_buffer_ref(cf->decoder_ref);
|
!(unmap_data->decoder_ref = av_buffer_ref(cf->decoder_ref))) {
|
||||||
|
ret = AVERROR(ENOMEM);
|
||||||
|
goto copy_fail;
|
||||||
|
}
|
||||||
|
|
||||||
av_pix_fmt_get_chroma_sub_sample(hwctx->sw_format, &shift_h, &shift_v);
|
av_pix_fmt_get_chroma_sub_sample(hwctx->sw_format, &shift_h, &shift_v);
|
||||||
for (i = 0; frame->linesize[i]; i++) {
|
for (i = 0; frame->linesize[i]; i++) {
|
||||||
|
Reference in New Issue
Block a user