rawdec: add check on sample_rate
authorStefano Sabatini <stefasab@gmail.com>
Wed, 26 Oct 2011 23:38:21 +0000 (01:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 18 Nov 2011 20:33:11 +0000 (21:33 +0100)
commit91805f06a39ca82e1463ebce578452d0e2f22bf6
tree9461a091258a1139ddab696465e4f748c858beff
parent8120a1d9bd4bcc4434b4f588f50c9d81aa8ad0e0
rawdec: add check on sample_rate

Prevent error condition in case sample_rate is unset or set to a negative
value. In particular, fix divide-by-zero error occurring in ffmpeg due to
sample_rate set to 0 in output_packet(), in code:

                ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) /
                    ist->st->codec->sample_rate;

Fix trac ticket #324.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rawdec.c