summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavcodec/vaapi_decode.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /media/ffvpx/libavcodec/vaapi_decode.c
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'media/ffvpx/libavcodec/vaapi_decode.c')
-rw-r--r--media/ffvpx/libavcodec/vaapi_decode.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/media/ffvpx/libavcodec/vaapi_decode.c b/media/ffvpx/libavcodec/vaapi_decode.c
index ceac769c52..5665639dd7 100644
--- a/media/ffvpx/libavcodec/vaapi_decode.c
+++ b/media/ffvpx/libavcodec/vaapi_decode.c
@@ -20,6 +20,7 @@
#include "libavutil/avassert.h"
#include "libavutil/common.h"
+#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
@@ -72,17 +73,14 @@ int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
av_assert0(pic->nb_slices <= pic->slices_allocated);
if (pic->nb_slices == pic->slices_allocated) {
- if (pic->slices_allocated > 0)
- pic->slices_allocated *= 2;
- else
- pic->slices_allocated = 64;
-
pic->slice_buffers =
av_realloc_array(pic->slice_buffers,
- pic->slices_allocated,
+ pic->slices_allocated ? pic->slices_allocated * 2 : 64,
2 * sizeof(*pic->slice_buffers));
if (!pic->slice_buffers)
return AVERROR(ENOMEM);
+
+ pic->slices_allocated = pic->slices_allocated ? pic->slices_allocated * 2 : 64;
}
av_assert0(pic->nb_slices + 1 <= pic->slices_allocated);