ass_split: accept files with only \n and no \r.
authorNicolas George <nicolas.george@normalesup.org>
Wed, 29 Feb 2012 12:46:32 +0000 (13:46 +0100)
committerNicolas George <nicolas.george@normalesup.org>
Wed, 7 Mar 2012 15:41:30 +0000 (16:41 +0100)
The +1 is there to skip the ','.
With \r\n, the +1 skips the \r but that is ok.
With only \n, the +1 skips it and all hell breaks loose.

libavcodec/ass_split.c

index 2a3b764..a0b7254 100644 (file)
@@ -232,7 +232,7 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
                         break;
                     }
                 (*number)++;
-                buf = skip_space(buf + len + 1);
+                buf = skip_space(buf + len + (buf[len] == ','));
             }
             ctx->field_order[ctx->current_section] = order;
         } else if (section->fields_header) {