mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Fix ff_get_guid for short reads or errors.
Current code would just return uninitialized data with no way to detect this condition. Instead, fill the whole GUID with 0 in that case. Fixes valgrind uninitialized data errors in fate-seek-lavf_asf. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
parent
719a576f04
commit
ea3abcd58f
@ -675,7 +675,8 @@ void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssiz
|
||||
void ff_get_guid(AVIOContext *s, ff_asf_guid *g)
|
||||
{
|
||||
assert(sizeof(*g) == 16);
|
||||
avio_read(s, *g, sizeof(*g));
|
||||
if (avio_read(s, *g, sizeof(*g)) < (int)sizeof(*g))
|
||||
memset(*g, 0, sizeof(*g));
|
||||
}
|
||||
|
||||
enum CodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid)
|
||||
|
Loading…
Reference in New Issue
Block a user