OSDN Git Service

vc1: fix a memleak.
authorAnton Khirnov <anton@khirnov.net>
Fri, 15 Nov 2013 14:33:20 +0000 (15:33 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 21 Nov 2013 19:57:36 +0000 (20:57 +0100)
Happens on a B-frame when neither low_delay nor last_picture_ptr is set
(probably corrupted streams only).

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
libavcodec/vc1dec.c

index 5c9eb8b..4a73d2c 100644 (file)
@@ -6097,12 +6097,11 @@ image:
             if ((ret = av_frame_ref(pict, &s->current_picture_ptr->f)) < 0)
                 goto err;
             ff_print_debug_info(s, s->current_picture_ptr);
+            *got_frame = 1;
         } else if (s->last_picture_ptr != NULL) {
             if ((ret = av_frame_ref(pict, &s->last_picture_ptr->f)) < 0)
                 goto err;
             ff_print_debug_info(s, s->last_picture_ptr);
-        }
-        if (s->last_picture_ptr || s->low_delay) {
             *got_frame = 1;
         }
     }