aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndrew Wason <rectalogic@rectalogic.com>2010-09-02 11:51:32 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-09-02 11:51:32 +0000
commit4ed899f2c5848b75b61d13ad42942ecc2a4386f9 (patch)
tree7c4863a470ef71b4808ba68b06567ba65a773feb /libavformat
parenta10a9f5cd06538c961943637f6c6c8f52cd257fc (diff)
downloadffmpeg-4ed899f2c5848b75b61d13ad42942ecc2a4386f9.tar.gz
Fix crash when decoding DV in AVI introduced in r24579 (issue 2174).
Patch by Andrew Wason, rectalogic rectalogic com Originally committed as revision 25023 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avidec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 9a56bbca69..f5b5c21a35 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -759,7 +759,7 @@ static AVStream *get_subtitle_pkt(AVFormatContext *s, AVStream *next_st,
for (i=0; i<s->nb_streams; i++) {
st = s->streams[i];
ast = st->priv_data;
- if (st->discard < AVDISCARD_ALL && ast->sub_pkt.data) {
+ if (st->discard < AVDISCARD_ALL && ast && ast->sub_pkt.data) {
ts = av_rescale_q(ast->sub_pkt.dts, st->time_base, AV_TIME_BASE_Q);
if (ts <= next_ts && ts < ts_min) {
ts_min = ts;
@@ -1294,12 +1294,14 @@ static int avi_read_close(AVFormatContext *s)
AVStream *st = s->streams[i];
AVIStream *ast = st->priv_data;
av_free(st->codec->palctrl);
+ if (ast) {
if (ast->sub_ctx) {
av_freep(&ast->sub_ctx->pb);
av_close_input_stream(ast->sub_ctx);
}
av_free(ast->sub_buffer);
av_free_packet(&ast->sub_pkt);
+ }
}
if (avi->dv_demux)