changeset 31149:8b1a6a6cda36

Avoid decoding of 0-size packets. This also fixes that the main loop believes tehre is an infinite number of delayed frames, thus never finishing (happens with -demuxer lavf -vc theora).
author reimar
date Sun, 23 May 2010 23:24:25 +0000
parents 6957d78df897
children 7886a9ada88e
files libmpcodecs/vd_theora.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_theora.c	Sun May 23 23:22:25 2010 +0000
+++ b/libmpcodecs/vd_theora.c	Sun May 23 23:24:25 2010 +0000
@@ -168,6 +168,10 @@
    yuv_buffer yuv;
    mp_image_t* mpi;
 
+   // no delayed frames
+   if (!data || !len)
+       return NULL;
+
    memset (&op, 0, sizeof (op));
    op.bytes = len;
    op.packet = data;