avfilter/palettegen: make sure at least one frame was sent to the filter
authorClément Bœsch <u@pkh.me>
Sun, 15 Mar 2015 18:09:16 +0000 (19:09 +0100)
committerClément Bœsch <u@pkh.me>
Sun, 15 Mar 2015 18:09:20 +0000 (19:09 +0100)
Fix FPE.

libavfilter/vf_palettegen.c

index 8b08140..4b49058 100644 (file)
@@ -504,7 +504,7 @@ static int request_frame(AVFilterLink *outlink)
     int r;
 
     r = ff_request_frame(inlink);
-    if (r == AVERROR_EOF && !s->palette_pushed) {
+    if (r == AVERROR_EOF && !s->palette_pushed && s->nb_refs) {
         r = ff_filter_frame(outlink, get_palette_frame(ctx));
         s->palette_pushed = 1;
         return r;