Commit 92e36ee5 authored by Clément Bœsch's avatar Clément Bœsch

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

parent 964465eb
...@@ -167,7 +167,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -167,7 +167,7 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap)
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
ModPlug_Settings settings; ModPlug_Settings settings;
ModPlugContext *modplug = s->priv_data; ModPlugContext *modplug = s->priv_data;
int r, sz = avio_size(pb); int sz = avio_size(pb);
if (sz < 0) { if (sz < 0) {
av_log(s, AV_LOG_WARNING, "Could not determine file size\n"); 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) ...@@ -179,10 +179,12 @@ static int modplug_read_header(AVFormatContext *s, AVFormatParameters *ap)
sz == FF_MODPLUG_DEF_FILE_SIZE ? " (see -max_size)" : "", sz); sz == FF_MODPLUG_DEF_FILE_SIZE ? " (see -max_size)" : "", sz);
} }
r = av_expr_parse(&modplug->expr, modplug->color_eval, var_names, if (modplug->color_eval) {
NULL, NULL, NULL, NULL, 0, s); int r = av_expr_parse(&modplug->expr, modplug->color_eval, var_names,
if (r < 0) NULL, NULL, NULL, NULL, 0, s);
return r; if (r < 0)
return r;
}
modplug->buf = av_malloc(modplug->max_size); modplug->buf = av_malloc(modplug->max_size);
if (!modplug->buf) if (!modplug->buf)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment