[FFmpeg-devel] [PATCH]Ignore leading comments in 3dl files

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Jul 17 08:58:15 CEST 2013


Hi!

The 3dl parser in the lut3d filter currently ignores comments (lines starting 
with "#") within the file but not on top.
Attached patch fixes the original issue in ticket #2787 assuming that files 
were always expected to start with the ignored line defining the 17 sampling 
intervals (as opposed to start either with a comment line or the sampling 
intervals, in this case a different patch is needed).

Please review, Carl Eugen
-------------- next part --------------
diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index ef1365d..48002b8 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -314,8 +314,7 @@ static int parse_3dl(AVFilterContext *ctx, FILE *f)
     const float scale = 16*16*16;
 
     lut3d->lutsize = size;
-    if (!fgets(line, sizeof(line), f))
-        return AVERROR_INVALIDDATA;
+    NEXT_LINE(skip_line(line));
     for (k = 0; k < size; k++) {
         for (j = 0; j < size; j++) {
             for (i = 0; i < size; i++) {


More information about the ffmpeg-devel mailing list