summaryrefslogtreecommitdiff
path: root/src/framing.c
Commit message (Collapse)AuthorAgeFilesLines
* framing: check for overflow on growing bufferClément Bœsch2020-08-101-1/+6
| | | | | | | newsize is a long, but storage is an int. This means the allocation could succeed but storage would overflow. Closes #2300
* src/framing.c: close compile warning under windows whith msbuildwillson-chen2020-04-251-1/+1
| | | | | | Close the C4244 warning while compiling under windows with cmake+msbuild. Signed-off-by: Tristan Matthews <tmatth@videolan.org>
* Fix memory leak in test_framingwillson-chen2019-08-121-0/+1
| | | | | | | | oy.data memory is alloc by ogg_sync_buffer(), but does not call free() before main() exit. After fixing it, I test test_framing by valgrind. And no more memory leak in test_framing and test_bitwise right now. Signed-off-by: Ralph Giles <giles@thaumas.net>
* Fix memory leak in test_framingwillson-chen2019-07-311-0/+2
| | | | | | | We call ogg_stream_init() in main() of framing.c, but no ogg_stream_clear() in corresponding. It will cause memory leak. Signed-off-by: Ralph Giles <giles@thaumas.net>
* Get rid of annoying C4456 warningEugene Opalev2019-03-181-3/+0
| | | | | Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com> Signed-off-by: Ralph Giles <giles@thaumas.net>
* framing: cast to unsigned when shifting to fix ubsan errorsTristan Matthews2019-03-061-11/+11
| | | | | | Suggested-By Mark Harris Fixes #2297
* Misc. typosluz.paz2018-10-091-2/+2
| | | | | | Found via `codespell -q 3` Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
* Switch to slicing-by-8 CRC32 algorithm.Robert Kausch2018-04-301-87/+43
|
* Remove obsolete $Id$ svn substitution marks.Ralph Giles2017-11-081-1/+0
| | | | | | | | | | Subversion, like cvs, had a mechanism for replacing inline template text on checkout for representing things like 'last modified date'. Git does not support this, so remove the template strings from file header comments. Also less aggressive language is os_types.h.
* configure: add --disable-crc optionTristan Matthews2017-11-071-0/+14
| | | | Useful for fuzzing
* Fix struct comparison in tests for Win64James Ross-Gowan2017-11-011-1/+29
| | | | | | | | | | | On 64-bit Windows, sizeof(unsigned char *) is 8, sizeof(long) is 4 and alignof(ogg_int64_t) is 8. This results in a 4-byte hole in ogg_packet after "long e_o_s", which means ogg_packet structs cannot be reliably compared by memcmp. Compare ogg_packet structs member-by-member instead. This fixes `make check` for me on mingw-w64/GCC. Signed-off-by: Ralph Giles <giles@thaumas.net>
* Make false continued packet handling consistentTimothy B. Terriberry2017-06-161-0/+1
| | | | | | | | | | | | | | | | | A false continued packet occurs if the previous page ended at the end of a packet, with no sequence number gap and no continued data on that page, while the current page has the continued packet flag set. Previously, if you drained all of the buffered packet data by repeatedly calling ogg_stream_packetout() after submitting the previous page but before submitting the current page, libogg would discard the continued data at the beggining of the current page. However, if you left the previous page's data in the buffer, then libogg would happily return the continued data at the start of the current page as a separate packet when you eventually did call ogg_stream_packetout(). This patch makes libogg consistently discard this data.
* Guard against very large packets.Tim Terriberry2013-01-081-13/+31
| | | | | | | Their size could overflow a long (especially on, e.g., Win64, where they could still fit in memory). svn path=/trunk/ogg/; revision=18758
* Fix a comment typo.Ralph Giles2011-08-041-1/+1
| | | | svn path=/trunk/ogg/; revision=18052
* Clean up whitespace.Ralph Giles2011-08-041-78/+74
| | | | | | Remove trailing whitespace and re-indent some comments. svn path=/trunk/ogg/; revision=18051
* Add ogg_stream_flush_fill to compliment ogg_stream_pageout_fill because ↵Gregory Maxwell2011-08-011-0/+8
| | | | | | ogg_stream_flush will produce multiple pages when >4096 bytes and >4 packets are available. svn path=/trunk/ogg/; revision=18044
* revert r17124 to match reversion of pagespill packet threshold from 8 to v1.2.1Monty2010-11-011-54/+21
| | | | | | | 4 svn path=/trunk/ogg/; revision=17592
* Revert default page spill from 8 to 4 packets.Monty2010-10-291-1/+1
| | | | svn path=/trunk/ogg/; revision=17579
* apply comment spell fix patch from Trac #1623Monty2010-10-271-2/+2
| | | | svn path=/trunk/ogg/; revision=17571
* Correct packet accumulation in _packetout to accumulate a full long of bytes, Monty2010-06-041-1/+1
| | | | | | | mathing the ogg_packet declaration. svn path=/trunk/ogg/; revision=17269
* Update make check to work properly with the new page spill heuristic from r17098Gregory Maxwell2010-04-051-21/+54
| | | | svn path=/trunk/ogg/; revision=17124
* Add a 'ogg_stream_pageout_fill' function to allow smart applications with ↵Gregory Maxwell2010-03-291-4/+19
| | | | | | delay sensitive flushing to produce big pages. Increase the default minimum fill amount to 8 based on latency measurements with actual files. These changes may be controversial but since we've recently had a release I thought there would be no harm in getting them into the repository for discussion. svn path=/trunk/ogg/; revision=17098
* Fix int vs long issues with the framing self-test code.Ralph Giles2010-03-261-3/+3
| | | | | | Warnings reported by clang (the llvm C compiler). svn path=/trunk/ogg/; revision=17060
* Update make check to work properly with the new page spill heuristicv1.2.0Monty2010-03-261-54/+225
| | | | svn path=/trunk/ogg/; revision=17039
* Modify default page flushing behavior;Monty2010-03-211-35/+58
| | | | | | | | | | 1) Don't unneccessarily span pages. 2) Unless necessary, don't flush pages if there are less than four packets on them; this expands page size to reduce unneccessary overhead if incoming packets are large. svn path=/trunk/ogg/; revision=16993
* DESTROY ALL TABSMonty2009-05-271-362/+362
| | | | svn path=/trunk/ogg/; revision=16051
* Complete fleshing out async error reporting interface in the source;Monty2009-05-271-14/+60
| | | | | | | | | makes it safe to ignore most return codes in applications and simply check occasionally to see if something went wrong at some earlier point. svn path=/trunk/ogg/; revision=16047
* Update configure script to use new 'legal' names for cache vals (I hate you ↵Monty2009-05-191-13/+34
| | | | | | | | | | | | | | | | | | | so much, autofoo) Update ogg to check the return of all allocs for those on embedded platforms with guarantees non-ovecommit. Be aware that these checks are useless on any modern desktop OS, but that embedded folks with no MMU and a hard heap boundary will benefit. Add one new call to bitpacker that will query a write-mode oggpack_buffer to see if it ran out of memory at some point; there was no other way to add the error reporting in an ABI-compatible manner (and it also allows the writepacker to avoid extra checks; it will just keep going after running out of memory without faulting and state can be queried later). svn path=/trunk/ogg/; revision=16016
* six const correct-ness fixeserikd2008-02-091-8/+8
| | | | svn path=/trunk/ogg/; revision=14463
* Add Andrew Donkin's iovec patch to libogg 1. Applied as-is after Monty2007-02-081-11/+24
| | | | | | | review. svn path=/trunk/ogg/; revision=12446
* Correct the test case data to expect a granulepos of -1 on pages whereRalph Giles2005-07-231-4/+4
| | | | | | | | | | | | no packet ends. The spec is clear about this but the unit tests assumed the old behaviour (carry over the previous granulepos) was correct. I did not verify the new CRC values by hand however, they are just copied from the library output. Also update changelog for the bug fix. svn path=/trunk/ogg/; revision=9601
* According to the Ogg specification, an ogg page that doesn't have any Mike Smith2005-07-221-2/+3
| | | | | | | | | packets ending on it (which commonly happens with video keyframes, for instance) must have a granulepos of -1. libogg never implemented this correctly; this patch ensures it does. svn path=/trunk/ogg/; revision=9598
* Remove obsolete doc reference.Ralph Giles2005-06-061-13/+12
| | | | svn path=/trunk/ogg/; revision=9371
* Fix for Josh Coalson's long-packet sync continuation bug. Passes all unit ↵Monty2004-09-221-3/+7
| | | | | | tests. svn path=/trunk/ogg/; revision=7835
* Added appropriate unit test to test for Josh's bug.Monty2004-09-221-14/+52
| | | | svn path=/trunk/ogg/; revision=7824
* free memory allocated in testing routines, to allow checks to pass inConrad Parker2004-08-191-0/+12
| | | | | | leak-checking environments svn path=/trunk/ogg/; revision=7586
* add explicit casts and consts to fix visual c compiler warningsConrad Parker2004-08-111-12/+12
| | | | | | | (patch from Colin Ward) + tested on linux/gcc svn path=/trunk/ogg/; revision=7525
* fix documentation errors. thanks to David K. Gasaway for pointing out the ↵Ralph Giles2002-09-291-6/+6
| | | | | | problem. svn path=/trunk/ogg/; revision=3964
* Xiphophorus -> Xiph.Org changesMonty2002-07-111-3/+3
| | | | svn path=/trunk/ogg/; revision=3577
* add 'ogg_stream_reset_serialno()' because it's useful. The sameMonty2002-03-071-1/+7
| | | | | | | | | functionality before required a clear/init cycle that involved free()/malloc(). Monty svn path=/trunk/ogg/; revision=3125
* lots of extremely minor fixesSegher Boessenkool2001-12-201-2/+2
| | | | svn path=/trunk/ogg/; revision=2867
* Added suggested public API exposure for regenerating checksum.Monty2001-11-241-15/+23
| | | | svn path=/trunk/ogg/; revision=2405
* Finally make the CRC lookup table a static initializer, like it alwaysMonty2001-11-241-21/+70
| | | | | | | | should have been. Monty svn path=/trunk/ogg/; revision=2402
* Fix to ogg_page_packets; it was looking for the wrong marker.Monty2001-11-221-2/+2
| | | | svn path=/trunk/ogg/; revision=2397
* Fixed another missing _ogg_ on a free() call, pointed out by Warren Spitz.Mike Smith2001-11-151-2/+2
| | | | | | Forgot to check libogg when I was checking for these yesterday... svn path=/trunk/ogg/; revision=2372
* sizeof() cleanup.Segher Boessenkool2001-10-021-19/+18
| | | | svn path=/trunk/ogg/; revision=2106
* optimization when using peek as a packet detectorMonty2001-05-241-1/+5
| | | | svn path=/trunk/ogg/; revision=1455
* Decided to alter behavior of packetpeek slightly:Monty2001-05-241-5/+3
| | | | | | | | | | | | | packetpeek can report -1 indicating a hole in the data (not really an error). Previously, packetout would have to be called to clear the hole; now, the hole is cleared by packetpeek. That is, the change is that ogg_stream_packetpeek must be followed by a call to ogg_stream_packetout(state,NULL) to continue advancing forward only if packetpeek returned a packet. svn path=/trunk/ogg/; revision=1454
* Minor API additions; none break compatability.Monty2001-05-241-21/+42
| | | | | | | | | | | | | added ogg_stream_packetpeek; returns the next packet from the stream stste without removing it from the stream. ogg_stream_packetout can now be passed a NULL packet pointer; in this case it removes the packet at the head of the stream and drops it on the floor. Monty svn path=/trunk/ogg/; revision=1453
* final beta 4 commitMonty2001-02-261-5/+5
| | | | | | | change to BSD license version update svn path=/trunk/ogg/; revision=1333