[FFmpeg-devel] [PATCH] vp9_parser: handle zero-sized packets.

Ronald S. Bultje rsbultje at gmail.com
Tue Dec 3 13:29:35 CET 2013


---
 libavcodec/vp9_parser.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/vp9_parser.c b/libavcodec/vp9_parser.c
index 6301936..24f588f 100644
--- a/libavcodec/vp9_parser.c
+++ b/libavcodec/vp9_parser.c
@@ -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];
-- 
1.8.4



More information about the ffmpeg-devel mailing list