diff mbox series

[FFmpeg-devel] avcodec/ivi: Fix indentation

Message ID HE1PR0301MB21545CCF0AF3BAC303867F8B8F4D9@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 3dacb09f105901cdb0ed10c8f2ac3fd9e884e038
Headers show
Series [FFmpeg-devel] avcodec/ivi: Fix indentation
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 15, 2021, 4:37 p.m. UTC
Also improve readability by keeping a pointer to the IVIBandDesc that is
currently freed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/ivi.c | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c
index a5074e9980..cefaf77bfd 100644
--- a/libavcodec/ivi.c
+++ b/libavcodec/ivi.c
@@ -268,18 +268,20 @@  static av_cold void ivi_free_buffers(IVIPlaneDesc *planes)
     int p, b, t;
 
     for (p = 0; p < 3; p++) {
-        if (planes[p].bands)
-        for (b = 0; b < planes[p].num_bands; b++) {
-            av_freep(&planes[p].bands[b].bufs[0]);
-            av_freep(&planes[p].bands[b].bufs[1]);
-            av_freep(&planes[p].bands[b].bufs[2]);
-            av_freep(&planes[p].bands[b].bufs[3]);
-
-            if (planes[p].bands[b].blk_vlc.cust_tab.table)
-                ff_free_vlc(&planes[p].bands[b].blk_vlc.cust_tab);
-            for (t = 0; t < planes[p].bands[b].num_tiles; t++)
-                av_freep(&planes[p].bands[b].tiles[t].mbs);
-            av_freep(&planes[p].bands[b].tiles);
+        if (planes[p].bands) {
+            for (b = 0; b < planes[p].num_bands; b++) {
+                IVIBandDesc *band = &planes[p].bands[b];
+                av_freep(&band->bufs[0]);
+                av_freep(&band->bufs[1]);
+                av_freep(&band->bufs[2]);
+                av_freep(&band->bufs[3]);
+
+                if (band->blk_vlc.cust_tab.table)
+                    ff_free_vlc(&band->blk_vlc.cust_tab);
+                for (t = 0; t < band->num_tiles; t++)
+                    av_freep(&band->tiles[t].mbs);
+                av_freep(&band->tiles);
+            }
         }
         av_freep(&planes[p].bands);
         planes[p].num_bands = 0;