summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-06-30 20:11:20 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-07-25 23:32:34 +0200
commitdb99ca21500534d1ca3eecc1039f1f45394569e1 (patch)
tree2ffbebe7817b74ac444ab768bf8dca95b7534d56
parentad2b755d3f5c7870f7d2e14da5d1c5e7ca8f3786 (diff)
avcodec/hevcdec: Check allocation
Also postpone it after the checks for invalid input. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavcodec/hevcdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index b03cb15b7e..8f7c186b00 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -2649,8 +2649,6 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal)
goto error;
}
- ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
-
for (i = 1; i < s->threads_number; i++) {
if (s->HEVClcList[i])
continue;
@@ -2704,6 +2702,9 @@ static int hls_slice_data_wpp(HEVCContext *s, const H2645NAL *nal)
}
atomic_store(&s->wpp_err, 0);
+ res = ff_alloc_entries(s->avctx, s->sh.num_entry_point_offsets + 1);
+ if (res < 0)
+ goto error;
ff_reset_entries(s->avctx);
for (i = 0; i <= s->sh.num_entry_point_offsets; i++) {