]> git.sesse.net Git - ffmpeg/commit
avcodec/mjpegdec: Fix leak in case ICC array allocations fail partially
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sat, 3 Apr 2021 13:39:35 +0000 (15:39 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Sat, 3 Apr 2021 20:26:51 +0000 (22:26 +0200)
commita5b2f06b0c69221e375edd918a335c68b33d5667
tree468b6afa5928d4cfa332e6714e19f41f10e0a5bf
parentda8c86dd8be244100da226a11b416c20d0c914d6
avcodec/mjpegdec: Fix leak in case ICC array allocations fail partially

If only one of the two arrays used for the ICC profile could be
successfully allocated, it might be overwritten and leak when
the next ICC entry is encountered. Fix this by using a common struct,
so that one has only one array to allocate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
libavcodec/mjpegdec.c
libavcodec/mjpegdec.h