summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2013-01-15 16:20:57 -0500
committerJustin Ruggles <justin.ruggles@gmail.com>2013-01-16 12:21:35 -0500
commitb805c725a31f6cb05c488e485eb6ab370a851633 (patch)
tree2f6f283b5ecf077a7eeba19105b131da06e01e2a /libavformat
parente034cc6c60c77dce390b1ac31141b1862bdf8999 (diff)
downloadffmpeg-b805c725a31f6cb05c488e485eb6ab370a851633.tar.gz
idcin: fix memleaks in idcin_read_packet()
Fixes fate-id-cin-video failures when running FATE with valgrind.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/idcin.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/idcin.c b/libavformat/idcin.c
index b7e87a719a..18da918f13 100644
--- a/libavformat/idcin.c
+++ b/libavformat/idcin.c
@@ -309,6 +309,7 @@ static int idcin_read_packet(AVFormatContext *s,
return ret;
else if (ret != chunk_size) {
av_log(s, AV_LOG_ERROR, "incomplete packet\n");
+ av_free_packet(pkt);
return AVERROR(EIO);
}
if (command == 1) {
@@ -316,8 +317,10 @@ static int idcin_read_packet(AVFormatContext *s,
pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
AVPALETTE_SIZE);
- if (ret < 0)
+ if (ret < 0) {
+ av_free_packet(pkt);
return ret;
+ }
memcpy(pal, palette, AVPALETTE_SIZE);
pkt->flags |= AV_PKT_FLAG_KEY;
}