aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-20 21:41:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-20 21:41:26 +0100
commit426ebdf923f9826e456bb734299fa2d2b6199524 (patch)
treef30fd4ac99579f87dec2bb4df06e30cbb0ee8859 /libavformat/mpeg.c
parentb853103fe0e59edc8970462abc6c181610ad9216 (diff)
parent2753d4ebf067593070ca4e9b3ea1dbe6ace23ba3 (diff)
downloadffmpeg-426ebdf923f9826e456bb734299fa2d2b6199524.tar.gz
Merge remote-tracking branch 'cigaes/master'
* cigaes/master: lavfi/vf_yadif: use standard options parsing. lavfi/vf_unsharp: use standard options parsing. lavfi/vf_transpose: use standard options parsing. lavfi/vf_pad: use standard options parsing. lavfi/vf_fps: use standard options parsing. lavfi/vf_fade: use standard options parsing. lavi/vf_drawbox: use standard options parsing. lavfi/vf_delogo: use standard options parsing. lavfi/vf_decimate: use standard options parsing. lavfi/vf_crop: use standard options parsing. lavfi/af_volume: use standard options parsing. lavfi/vf_tile: use standard options parsing. lavfi/avf_concat: use standard options parsing. lavfi: add common code to handle options parsing. lavf/vobsub: free index pseudo-packet. ffmpeg: fix freeing of sub2video frame. lavfi: add sine audio source. lavu/opt: add AV_OPT_TYPE_DURATION. lavfi/concat: fix silence duration computation. lavf/concatdec: support seeking. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpeg.c')
-rw-r--r--libavformat/mpeg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 5387b092e4..f36f0db727 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -805,6 +805,8 @@ end:
return ret;
}
+#define FAIL(r) do { ret = r; goto fail; } while (0)
+
static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MpegDemuxContext *vobsub = s->priv_data;
@@ -838,7 +840,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = mpegps_read_pes_header(vobsub->sub_ctx, NULL, &startcode, &pts, &dts);
if (ret < 0)
- return ret;
+ FAIL(ret);
to_read = ret & 0xffff;
/* this prevents reads above the current packet */
@@ -855,7 +857,7 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
ret = av_grow_packet(pkt, to_read);
if (ret < 0)
- return ret;
+ FAIL(ret);
n = avio_read(pb, pkt->data + (pkt->size - to_read), to_read);
if (n < to_read)
@@ -870,7 +872,12 @@ static int vobsub_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->pos = idx_pkt.pos;
pkt->stream_index = idx_pkt.stream_index;
+ av_free_packet(&idx_pkt);
return 0;
+
+fail:
+ av_free_packet(&idx_pkt);
+ return ret;
}
static int vobsub_read_seek(AVFormatContext *s, int stream_index,