diff mbox series

[FFmpeg-devel,8/8] avformat/flac_picture: Reindentation

Message ID AM7PR03MB6660BC82810303B55418D1E38FC49@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 0871273a2ff8e7ec7d44d9b4e24e2d78346eb2f0
Headers show
Series [FFmpeg-devel,1/8] avformat/vorbiscomment: Don't compute strlen twice | expand

Checks

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

Commit Message

Andreas Rheinhardt Aug. 23, 2021, 1:16 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/flac_picture.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c
index 3b69654ff6..0effbf04f6 100644
--- a/libavformat/flac_picture.c
+++ b/libavformat/flac_picture.c
@@ -150,19 +150,18 @@  int ff_flac_parse_picture(AVFormatContext *s, uint8_t **bufp, int buf_size,
         data->data += bytestream2_tell(&g);
         data->size  = len + AV_INPUT_BUFFER_PADDING_SIZE;
     } else {
-    if (!(data = av_buffer_alloc(len + AV_INPUT_BUFFER_PADDING_SIZE))) {
-        return AVERROR(ENOMEM);
-    }
+        if (!(data = av_buffer_alloc(len + AV_INPUT_BUFFER_PADDING_SIZE)))
+            return AVERROR(ENOMEM);
 
-    if (trunclen == 0) {
-        bytestream2_get_bufferu(&g, data->data, len);
-    } else {
-        // If truncation was detected copy all data from block and read missing bytes
-        // not included in the block size
-        bytestream2_get_bufferu(&g, data->data, left);
-        if (avio_read(s->pb, data->data + len - trunclen, trunclen) < trunclen)
-            RETURN_ERROR(AVERROR_INVALIDDATA);
-    }
+        if (trunclen == 0) {
+            bytestream2_get_bufferu(&g, data->data, len);
+        } else {
+            // If truncation was detected copy all data from block and
+            // read missing bytes not included in the block size.
+            bytestream2_get_bufferu(&g, data->data, left);
+            if (avio_read(s->pb, data->data + len - trunclen, trunclen) < trunclen)
+                RETURN_ERROR(AVERROR_INVALIDDATA);
+        }
     }
     memset(data->data + len, 0, AV_INPUT_BUFFER_PADDING_SIZE);