gst/typefind/gsttypefindfunctions.c: Avoid integer underflow when the found probability for mp3 is smaller than the '...

Original commit message from CVS:
* gst/typefind/gsttypefindfunctions.c: (mp3_type_find_at_offset):
Avoid integer underflow when the found probability for mp3 is
smaller than the 'penalty' we subtract if there's not a clean
mp3 header sync at offset 0.
This commit is contained in:
Tim-Philipp Müller 2006-11-21 09:29:56 +00:00
parent 4607e3d116
commit 67e6bb5a92
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2006-11-21 Tim-Philipp Müller <tim at centricular dot net>
* gst/typefind/gsttypefindfunctions.c: (mp3_type_find_at_offset):
Avoid integer underflow when the found probability for mp3 is
smaller than the 'penalty' we subtract if there's not a clean
mp3 header sync at offset 0.
2006-11-21 Stefan Kost <ensonic@users.sf.net>
* docs/libs/gst-plugins-base-libs-sections.txt:

View file

@ -726,7 +726,7 @@ mp3_type_find_at_offset (GstTypeFind * tf, guint64 start_off,
GST_MP3_TYPEFIND_TRY_HEADERS / GST_MP3_TYPEFIND_TRY_SYNC;
if (!headerstart
&& ((probability - GST_MP3_WRONG_HEADER) > GST_TYPE_FIND_MINIMUM))
&& probability > (GST_TYPE_FIND_MINIMUM + GST_MP3_WRONG_HEADER))
probability -= GST_MP3_WRONG_HEADER;
if (probability < GST_TYPE_FIND_MINIMUM)
probability = GST_TYPE_FIND_MINIMUM;