diff mbox series

[FFmpeg-devel,6/6] sws: replace av_fast_realloc() with av_realloc_reuse()

Message ID 20220928104854.18629-6-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/6] lavu/mem: add av_realloc_reuse() as a replacement for av_fast_realloc() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Sept. 28, 2022, 10:48 a.m. UTC
---
 libswscale/swscale_internal.h | 2 +-
 libswscale/utils.c            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index abeebbb002..1566bb50fe 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -91,7 +91,7 @@  typedef struct Range {
 typedef struct RangeList {
     Range          *ranges;
     unsigned int nb_ranges;
-    int             ranges_allocated;
+    size_t          ranges_allocated;
 } RangeList;
 
 int ff_range_add(RangeList *r, unsigned int start, unsigned int len);
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 45baa22b23..67d1cd9fd5 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -2570,8 +2570,8 @@  int ff_range_add(RangeList *rl, unsigned int start, unsigned int len)
             return AVERROR(EINVAL);
     }
 
-    tmp = av_fast_realloc(rl->ranges, &rl->ranges_allocated,
-                          (rl->nb_ranges + 1) * sizeof(*rl->ranges));
+    tmp = av_realloc_reuse(rl->ranges, &rl->ranges_allocated,
+                           (rl->nb_ranges + 1) * sizeof(*rl->ranges));
     if (!tmp)
         return AVERROR(ENOMEM);
     rl->ranges = tmp;