Browse code

avfilter/palettegen: make sure at least one frame was sent to the filter

Fix FPE.

(cherry picked from commit 84da9339c21f679836a024ce86a69c6ea4a6fd11)

Clément Bœsch authored on 2015/03/16 03:09:16
Showing 1 changed files
... ...
@@ -504,7 +504,7 @@ static int request_frame(AVFilterLink *outlink)
504 504
     int r;
505 505
 
506 506
     r = ff_request_frame(inlink);
507
-    if (r == AVERROR_EOF && !s->palette_pushed) {
507
+    if (r == AVERROR_EOF && !s->palette_pushed && s->nb_refs) {
508 508
         r = ff_filter_frame(outlink, get_palette_frame(ctx));
509 509
         s->palette_pushed = 1;
510 510
         return r;