theoraenc: Don't call gst_buffer_fill() for empty Theora packets
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 7 May 2013 08:16:48 +0000 (10:16 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Tue, 7 May 2013 08:16:48 +0000 (10:16 +0200)
gst_buffer_fill() does not like a NULL source data pointer.

ext/theora/gsttheoraenc.c

index fcae87f..37ca24b 100644 (file)
@@ -633,7 +633,8 @@ theora_push_packet (GstTheoraEnc * enc, ogg_packet * packet)
     goto done;
   }
 
-  gst_buffer_fill (frame->output_buffer, 0, packet->packet, packet->bytes);
+  if (packet->bytes > 0)
+    gst_buffer_fill (frame->output_buffer, 0, packet->packet, packet->bytes);
 
   /* the second most significant bit of the first data byte is cleared
    * for keyframes */