Browse Source

idroqdec: fix leaking pkt on failure

The code calls av_new_packet a few lines above and the allocated memory
has to be freed in case of an error.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
tags/n3.3
Andreas Cadhalpun 9 years ago
parent
commit
c0175fa92b
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/idroqdec.c

+ 3
- 1
libavformat/idroqdec.c View File

@@ -222,8 +222,10 @@ static int roq_read_packet(AVFormatContext *s,
pkt->pos= avio_tell(pb);
ret = avio_read(pb, pkt->data + RoQ_CHUNK_PREAMBLE_SIZE,
chunk_size);
if (ret != chunk_size)
if (ret != chunk_size) {
av_packet_unref(pkt);
ret = AVERROR(EIO);
}

packet_read = 1;
break;


Loading…
Cancel
Save