mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
mad: ensure we do not confuse the base class with our buffer guard
mad expects extra bytes at the end of a buffer (see discussion in http://www.mars.org/mailman/public/mad-dev/2001-May/000262.html), and since we inject these without the base class' knowledge, we need to hide the bodies better. This fixes an assert at EOS when decoding an mp3 manually without an intervening mpegaudioparse.
This commit is contained in:
parent
4322fd0752
commit
73330c2ab8
1 changed files with 11 additions and 0 deletions
|
@ -415,6 +415,17 @@ exit:
|
|||
*_offset = offset;
|
||||
*len = consumed;
|
||||
|
||||
/* ensure that if we added some dummy guard bytes above, we don't claim
|
||||
to have used them as they're unknown to the caller. */
|
||||
if (mad->eos) {
|
||||
g_assert (av >= MAD_BUFFER_GUARD);
|
||||
av -= MAD_BUFFER_GUARD;
|
||||
if (*_offset > av)
|
||||
*_offset = av;
|
||||
if (*len > av)
|
||||
*len = av;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue