[FFmpeg-cvslog] cinepak: Fix division by zero, ask for sample if encoded_buf_size is 0
Michael Niedermayer
git at videolan.org
Sat Nov 19 02:09:43 CET 2011
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 16 15:10:26 2011 +0100| [b55aa7df6b79746541f05d65c414961f49f46f68] | committer: Martin Storsjö
cinepak: Fix division by zero, ask for sample if encoded_buf_size is 0
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b55aa7df6b79746541f05d65c414961f49f46f68
---
libavcodec/cinepak.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index f8b5352..0dbdeab 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -330,6 +330,10 @@ static int cinepak_decode (CinepakContext *s)
/* if this is the first frame, check for deviant Sega FILM data */
if (s->sega_film_skip_bytes == -1) {
+ if (!encoded_buf_size) {
+ av_log_ask_for_sample(s->avctx, "encoded_buf_size is 0");
+ return -1;
+ }
if (encoded_buf_size != s->size && (s->size % encoded_buf_size) != 0) {
/* If the encoded frame size differs from the frame size as indicated
* by the container file, this data likely comes from a Sega FILM/CPK file.
More information about the ffmpeg-cvslog
mailing list