mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
31ea5a204f
--HG-- extra : rebase_source : a1f68e1f64581029b9624fd57a897f0085dd126b
30 lines
972 B
Diff
30 lines
972 B
Diff
diff --git a/media/liboggplay/src/liboggplay/oggplay_data.c b/media/liboggplay/src/liboggplay/oggplay_data.c
|
|
--- a/media/liboggplay/src/liboggplay/oggplay_data.c
|
|
+++ b/media/liboggplay/src/liboggplay/oggplay_data.c
|
|
@@ -353,22 +353,19 @@ oggplay_data_handle_audio_data (OggPlayD
|
|
OggPlayErrorCode
|
|
oggplay_data_handle_cmml_data(OggPlayDecode *decode,
|
|
unsigned char *data,
|
|
long size) {
|
|
|
|
OggPlayTextRecord * record = NULL;
|
|
size_t record_size = sizeof(OggPlayTextRecord);
|
|
|
|
- /* check that the size we want to allocate doesn't overflow */
|
|
- if ((size < 0) || (size+1 < 0)) {
|
|
- return E_OGGPLAY_TYPE_OVERFLOW;
|
|
- }
|
|
- size += 1;
|
|
-
|
|
+ /* Include extra byte for null terminating record data buffer */
|
|
+ record_size += 1;
|
|
+
|
|
if
|
|
(
|
|
oggplay_check_add_overflow (record_size, size, &record_size)
|
|
==
|
|
E_OGGPLAY_TYPE_OVERFLOW
|
|
)
|
|
{
|
|
return E_OGGPLAY_TYPE_OVERFLOW;
|