OSDN Git Service

vp9_parser: handle zero-sized packets.
authorRonald S. Bultje <rsbultje@gmail.com>
Tue, 3 Dec 2013 12:29:35 +0000 (07:29 -0500)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 3 Dec 2013 13:06:34 +0000 (14:06 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vp9_parser.c

index 6301936..24f588f 100644 (file)
@@ -45,6 +45,13 @@ static int parse(AVCodecParserContext *ctx,
     VP9ParseContext *s = ctx->priv_data;
     int marker;
 
+    if (size <= 0) {
+        *out_size = 0;
+        *out_data = data;
+
+        return 0;
+    }
+
     if (s->n_frames > 0) {
         *out_data = data;
         *out_size = s->size[--s->n_frames];