• Andreas Rheinhardt's avatar
    avformat/avc, mxfenc: Avoid allocation of H264 SPS structure, fix memleak · 3cf212f6
    Andreas Rheinhardt authored
    Up until now, ff_avc_decode_sps would parse a SPS and return some
    properties from it in a freshly allocated structure. Yet said structure
    is very small and completely internal to libavformat, so there is no
    reason to use the heap for it. This commit therefore changes the
    function to return an int and to modify a caller-provided structure.
    This will also allow ff_avc_decode_sps to return better error codes in
    the future.
    
    It also fixes a memleak in mxfenc: If a packet contained multiple SPS,
    only the SPS structure belonging to the last SPS would be freed, the
    other ones would leak when the pointer is overwritten to point to the
    new SPS structure. Of course, without allocations there are no leaks.
    This is Coverity issue #1445194.
    
    Furthermore, the SPS structure has been renamed from
    H264SequenceParameterSet to H264SPS in order to avoid overlong lines.
    Reviewed-by: 's avatarTomas Härdin <tjoppen@acc.umu.se>
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    (cherry picked from commit a0b6df0a3953e2586e63f513485c4d2d42507d7f)
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    3cf212f6
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
RELEASE_NOTES Loading commit data...
configure Loading commit data...