avformat/mov: Free encryption data on error
Fixes memleak and Coverity issue #1439587.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3999c4b374
)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
@ -6308,8 +6308,10 @@ static int mov_read_pssh(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
if (version > 0) {
|
if (version > 0) {
|
||||||
kid_count = avio_rb32(pb);
|
kid_count = avio_rb32(pb);
|
||||||
if (kid_count >= INT_MAX / sizeof(*key_ids))
|
if (kid_count >= INT_MAX / sizeof(*key_ids)) {
|
||||||
return AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < kid_count && !pb->eof_reached; i++) {
|
for (unsigned int i = 0; i < kid_count && !pb->eof_reached; i++) {
|
||||||
unsigned int min_kid_count = FFMIN(FFMAX(i + 1, 1024), kid_count);
|
unsigned int min_kid_count = FFMIN(FFMAX(i + 1, 1024), kid_count);
|
||||||
|
Reference in New Issue
Block a user