diff mbox series

[FFmpeg-devel,4/4] avcodec/avcodec: Simplify accessing AVSubtitleRect via dedicated pointer

Message ID AS8PR01MB7944E2BE4023D87E45931A358FEC9@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit f6e167998f258dd69cd5e66e8bea52590bdec75a
Headers show
Series [FFmpeg-devel,1/4] avcodec/encode: Fix check for encoders impl. encode-simple API | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 13, 2022, 2:49 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/avcodec.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 0d971a61d4..d11f035481 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -452,12 +452,15 @@  void avsubtitle_free(AVSubtitle *sub)
     int i;
 
     for (i = 0; i < sub->num_rects; i++) {
-        av_freep(&sub->rects[i]->data[0]);
-        av_freep(&sub->rects[i]->data[1]);
-        av_freep(&sub->rects[i]->data[2]);
-        av_freep(&sub->rects[i]->data[3]);
-        av_freep(&sub->rects[i]->text);
-        av_freep(&sub->rects[i]->ass);
+        AVSubtitleRect *const rect = sub->rects[i];
+
+        av_freep(&rect->data[0]);
+        av_freep(&rect->data[1]);
+        av_freep(&rect->data[2]);
+        av_freep(&rect->data[3]);
+        av_freep(&rect->text);
+        av_freep(&rect->ass);
+
         av_freep(&sub->rects[i]);
     }