diff mbox series

[FFmpeg-devel] avformat/mov: move av_freep to if block to reduce no-ops

Message ID tencent_E026C9E7C9AA871338DC694BB2E60B90AB06@qq.com
State New
Headers show
Series [FFmpeg-devel] avformat/mov: move av_freep to if block to reduce no-ops | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zhao Zhili Sept. 23, 2020, 4:47 p.m. UTC
Use the check since it's there already.
---
 libavformat/mov.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4f64e96bc0..dcd263b02a 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2909,9 +2909,10 @@  static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     av_log(c->fc, AV_LOG_TRACE, "track[%u].stts.entries = %u\n",
             c->fc->nb_streams-1, entries);
 
-    if (sc->stts_data)
+    if (sc->stts_data) {
         av_log(c->fc, AV_LOG_WARNING, "Duplicated STTS atom\n");
-    av_freep(&sc->stts_data);
+        av_freep(&sc->stts_data);
+    }
     sc->stts_count = 0;
     if (entries >= INT_MAX / sizeof(*sc->stts_data))
         return AVERROR(ENOMEM);