[FFmpeg-cvslog] libmodplug: do not call av_expr_parse() in case of no expr specified.

Clément Bœsch git at videolan.org
Mon Oct 10 21:16:30 CEST 2011


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Mon Oct 10 21:15:26 2011 +0200| [92e36ee567fdeb8ec208996108c0cfa75e998fac] | committer: Clément Bœsch

libmodplug: do not call av_expr_parse() in case of no expr specified.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=92e36ee567fdeb8ec208996108c0cfa75e998fac
---

 libavformat/libmodplug.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavformat/libmodplug.c b/libavformat/libmodplug.c
index 4abba18..83e9322 100644
--- a/libavformat/libmodplug.c
+++ b/libavformat/libmodplug.c
@@ -167,7 +167,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap)
     AVIOContext *pb = s->pb;
     ModPlug_Settings settings;
     ModPlugContext *modplug = s->priv_data;
-    int r, sz = avio_size(pb);
+    int sz = avio_size(pb);
 
     if (sz < 0) {
         av_log(s, AV_LOG_WARNING, "Could not determine file size\n");
@@ -179,10 +179,12 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap)
                sz == FF_MODPLUG_DEF_FILE_SIZE ? " (see -max_size)" : "", sz);
     }
 
-    r = av_expr_parse(&modplug->expr, modplug->color_eval, var_names,
-                      NULL, NULL, NULL, NULL, 0, s);
-    if (r < 0)
-        return r;
+    if (modplug->color_eval) {
+        int r = av_expr_parse(&modplug->expr, modplug->color_eval, var_names,
+                              NULL, NULL, NULL, NULL, 0, s);
+        if (r < 0)
+            return r;
+    }
 
     modplug->buf = av_malloc(modplug->max_size);
     if (!modplug->buf)



More information about the ffmpeg-cvslog mailing list