From 67e6bb5a927391cdebf0077f984b18afb49d43c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 21 Nov 2006 09:29:56 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ gst/typefind/gsttypefindfunctions.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 608187fe3f..609c4b22d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-11-21 Tim-Philipp Müller + + * 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 * docs/libs/gst-plugins-base-libs-sections.txt: diff --git a/gst/typefind/gsttypefindfunctions.c b/gst/typefind/gsttypefindfunctions.c index 376ef4f571..7b5bc37616 100644 --- a/gst/typefind/gsttypefindfunctions.c +++ b/gst/typefind/gsttypefindfunctions.c @@ -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;