Robert Shih
2016-Mar-14 19:34 UTC
[flac-dev] [PATCH] update obj->num_comments if short circuit in read_metadata_vorbiscomment_
In function read_metadata_vorbiscomment_ from stream_decoder.c, at various locations where we short circuit the computation, we also set `obj->num_comments` accordingly. For example: https://git.xiph.org/?p=flac.git;a=blob;f=src/libFLAC/stream_decoder.c;h=e0f1b14d30dd548268a88e4341af3f38290816e3;hb=HEAD#l1736 https://git.xiph.org/?p=flac.git;a=blob;f=src/libFLAC/stream_decoder.c;h=e0f1b14d30dd548268a88e4341af3f38290816e3;hb=HEAD#l1741 https://git.xiph.org/?p=flac.git;a=blob;f=src/libFLAC/stream_decoder.c;h=e0f1b14d30dd548268a88e4341af3f38290816e3;hb=HEAD#l1752 https://git.xiph.org/?p=flac.git;a=blob;f=src/libFLAC/stream_decoder.c;h=e0f1b14d30dd548268a88e4341af3f38290816e3;hb=HEAD#l1758 https://git.xiph.org/?p=flac.git;a=blob;f=src/libFLAC/stream_decoder.c;h=e0f1b14d30dd548268a88e4341af3f38290816e3;hb=HEAD#l1763 https://git.xiph.org/?p=flac.git;a=blob;f=src/libFLAC/stream_decoder.c;h=e0f1b14d30dd548268a88e4341af3f38290816e3;hb=HEAD#l1774 Would it be appropriate to do the same thing should safe_malloc_add_2op_ fail? Attached patch to illustrate what I mean. -------------- next part -------------- A non-text attachment was scrubbed... Name: num_comments.patch Type: application/octet-stream Size: 625 bytes Desc: not available Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20160314/f3f8d848/attachment.obj
Erik de Castro Lopo
2016-Mar-20 05:00 UTC
[flac-dev] [PATCH] update obj->num_comments if short circuit in read_metadata_vorbiscomment_
Robert Shih wrote:> In function read_metadata_vorbiscomment_ from stream_decoder.c, at > various locations where we short circuit the computation, we also set > `obj->num_comments` accordingly. For example:Patch applied. Thanks. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/