diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-16 04:25:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-16 04:25:07 +0200 |
commit | a39c5c4c6baafcef0c6ec7c6f59bc3fee81b2599 (patch) | |
tree | 3b2cc72bf898c016330eb58f5f30cd81304484b9 /libavformat/dv.c | |
parent | f0896a6bd94e5b45447c7d640c8e8aa95d860d7a (diff) | |
download | ffmpeg-a39c5c4c6baafcef0c6ec7c6f59bc3fee81b2599.tar.gz |
dv: fix null ptr dereference
Fixes Ticket1640
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/dv.c')
-rw-r--r-- | libavformat/dv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c index fff55ab255..0da3e9ef65 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -419,9 +419,13 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c, void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset) { c->frames= frame_offset; - if (c->ach) + if (c->ach) { + if (c->sys) { c->abytes= av_rescale_q(c->frames, c->sys->time_base, (AVRational){8, c->ast[0]->codec->bit_rate}); + }else + av_log(c->fctx, AV_LOG_ERROR, "cannot adjust audio bytes\n"); + } c->audio_pkt[0].size = c->audio_pkt[1].size = 0; c->audio_pkt[2].size = c->audio_pkt[3].size = 0; } |