a52dec: fix first_access bigger than 2
authorAlban Browaeys <prahal@yahoo.com>
Mon, 2 Apr 2012 17:31:20 +0000 (19:31 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 15 Apr 2012 13:46:35 +0000 (14:46 +0100)
gst_buffer_extract returns the number of bytes extracted, here 2 max.
Set size to the buffer size as was done in 0.10 to avoid first_access
error when it bypass 2.

https://bugzilla.gnome.org/show_bug.cgi?id=673434

ext/a52dec/gsta52dec.c

index f684721..290ae47 100644 (file)
@@ -670,10 +670,11 @@ gst_a52dec_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
     gint len;
     GstBuffer *subbuf;
 
-    size = gst_buffer_extract (buf, 0, data, 2);
+    size = gst_buffer_get_size (buf);
     if (size < 2)
       goto not_enough_data;
 
+    gst_buffer_extract (buf, 0, data, 2);
     first_access = (data[0] << 8) | data[1];
 
     /* Skip the first_access header */