avcodec/wmavoice: set sframe_cache_size to the number of bits actually cached copy_bits() silently writes nothing when the requested bits do not fit the 256 byte superframe cache or exceed what is left in the packet, but sframe_cache_size was set to the requested count regardless. On the next packet the spillover bits were then appended at offset 0 and decoded as a superframe of their own, or with no spillover, stale bytes from an earlier packet were decoded again. Use put_bits_count() so the size always matches the cache content. A leftover larger than the cache is dropped instead, which is correct: a speech superframe never needs more than about 1300 bits, so such a leftover cannot be one. Bit reads never left sframe_cache, so this is not a memory safety issue; the bogus superframes and the decoder errors they produced on the affected samples are gone. Using put_bits_count() for the size was suggested by the reporter. Found-by: zhang xingxing <2388969553@qq.com> Fixes: ZAKu08c7UMiZ
FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.
libavcodec provides implementation of a wider range of codecs.libavformat implements streaming protocols, container formats and basic I/O access.libavutil includes hashers, decompressors and miscellaneous utility functions.libavfilter provides means to alter decoded audio and video through a directed graph of connected filters.libavdevice provides an abstraction to access capture and playback devices.libswresample implements audio mixing and resampling routines.libswscale implements color conversion and scaling routines.aviocat, ismindex and qt-faststart.The offline documentation is available in the doc/ directory.
The online documentation is available in the main website and in the wiki.
Coding examples are available in the doc/examples directory.
FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.
Patches should be submitted to the ffmpeg-devel mailing list using git format-patch or git send-email. Github pull requests should be avoided because they are not part of our review process and will be ignored.