Bug 475441. Bail out a little earlier in liboggz to avoid crashing when an I/O error occurs during a seek. r=conrad

--HG--
extra : rebase_source : eb3549c17d5ff38c56ab1a38394dfa1f15fc31a3
This commit is contained in:
Robert O'Callahan 2009-04-01 13:52:55 +13:00
Родитель 860d8f6828
Коммит 5cc4948d0c
4 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -10,3 +10,6 @@ The wince.patch addresses the lack of posix file IO support on windows ce,
see bug 461844 for details.
endian.patch is applied to fix bug 452698.
oggz-seek-crash-fix.patch is applied to fix the crash reported in
bug 475441 comment #44.

Просмотреть файл

@ -0,0 +1,22 @@
diff --git a/media/liboggz/src/liboggz/oggz_seek.c b/media/liboggz/src/liboggz/oggz_seek.c
--- a/media/liboggz/src/liboggz/oggz_seek.c
+++ b/media/liboggz/src/liboggz/oggz_seek.c
@@ -717,17 +717,17 @@ oggz_seek_set (OGGZ * oggz, ogg_int64_t
&serialno);
unit_end = oggz_get_unit (oggz, serialno, granule_at);
#ifdef DEBUG
printf ("oggz_seek_set: [C] offset_next @%" PRI_OGGZ_OFF_T "d, g%lld, (s%ld)\n",
offset_next, granule_at, serialno);
printf ("oggz_seek_set: [c] u%lld\n",
oggz_get_unit (oggz, serialno, granule_at));
#endif
- } else {
+ } else if (offset_next >= 0) {
serialno = ogg_page_serialno (og);
granule_at = ogg_page_granulepos (og);
}
if (offset_next < 0) {
goto notfound;
}

Просмотреть файл

@ -722,7 +722,7 @@ oggz_seek_set (OGGZ * oggz, ogg_int64_t unit_target)
printf ("oggz_seek_set: [c] u%lld\n",
oggz_get_unit (oggz, serialno, granule_at));
#endif
} else {
} else if (offset_next >= 0) {
serialno = ogg_page_serialno (og);
granule_at = ogg_page_granulepos (og);
}

Просмотреть файл

@ -47,3 +47,4 @@ cp $1/AUTHORS ./AUTHORS
patch -p3 <wince.patch
patch -p3 <endian.patch
patch -p4 <seek.patch
patch -p3 <seek-error-fix.patch