GNOME Bugzilla – Bug 779515
vorbisdec: Reset decoder in more situations
Last modified: 2017-03-03 10:41:20 UTC
See commit message
Created attachment 347121 [details] [review] vorbisdec: Reset decoder in more situations This is a followup commit to b95725c37e70ad3c1ec8dadb401388db375df482 * Resetting the decoder should only happen when we get a new initialization header (0x01) and not on the other headers * The initialized variable only gets set to TRUE once all headers have been parsed. Also check if the vorbis_info struct has been properly resetted also. Failure to do that would cause vorbisdec to error if it got two initialization header in a row (the first would configure the underlying library and the second one would error out because it's already initialized)
Review of attachment 347121 [details] [review]: ::: ext/vorbis/gstvorbisdec.c @@ +587,3 @@ + * initialized yet. */ + if ((vd->initialized || (vd->vi.rate != 0)) && + (gst_ogg_packet_data (packet))[0] == 0x01) { Also the second header with the huffman tables I guess. Just not on comment headers
Review of attachment 347121 [details] [review]: ::: ext/vorbis/gstvorbisdec.c @@ +587,3 @@ + * initialized yet. */ + if ((vd->initialized || (vd->vi.rate != 0)) && + (gst_ogg_packet_data (packet))[0] == 0x01) { That would require a more granular system *IF* it's an actual scenario that can happen. If you reset everything when you get a huffmann table, it will then refuse to decode (it doesn't have the generic information contained in the initialization header).
Comment on attachment 347121 [details] [review] vorbisdec: Reset decoder in more situations Good point. I'd worry about that then if we ever see such a stream. Go ahead then :)
commit e575be6dc6689950299049928ad135e456aa07a2 Author: Edward Hervey <edward@centricular.com> Date: Fri Mar 3 10:52:15 2017 +0100 vorbisdec: Reset decoder in more situations This is a followup commit to b95725c37e70ad3c1ec8dadb401388db375df482 * Resetting the decoder should only happen when we get a new initialization header (0x01) and not on the other headers * The initialized variable only gets set to TRUE once all headers have been parsed. Also check if the vorbis_info struct has been properly resetted also. Failure to do that would cause vorbisdec to error if it got two initialization header in a row (the first would configure the underlying library and the second one would error out because it's already initialized) https://bugzilla.gnome.org/show_bug.cgi?id=779515