00-fix-crash-0-byte-ogg.patch 769 B

1234567891011121314151617181920212223
  1. From 7f22e3ea7f713867e1fbf2ef71b6a6e36e1f0531 Mon Sep 17 00:00:00 2001
  2. From: Jonathan Liu <net147@gmail.com>
  3. Date: Sun, 28 Oct 2012 10:07:16 +0000
  4. Subject: oggstream: fix crash with 0 byte ogg packets
  5. https://bugzilla.gnome.org/show_bug.cgi?id=687030
  6. ---
  7. diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c
  8. index c79f088..fe28f2e 100644
  9. --- a/ext/ogg/gstoggstream.c
  10. +++ b/ext/ogg/gstoggstream.c
  11. @@ -790,7 +790,7 @@ setup_vorbis_mapper (GstOggStream * pad, ogg_packet * packet)
  12. static gboolean
  13. is_header_vorbis (GstOggStream * pad, ogg_packet * packet)
  14. {
  15. - if (packet->bytes > 0 && (packet->packet[0] & 0x01) == 0)
  16. + if (packet->bytes == 0 || (packet->packet[0] & 0x01) == 0)
  17. return FALSE;
  18. if (packet->packet[0] == 5) {
  19. --
  20. cgit v0.9.0.2-2-gbebe