diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-16 15:10:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-16 15:19:57 +0100 |
commit | 4e7b3ef3b3cf71479dde1d4ae644eaf4857c4813 (patch) | |
tree | 7c76b17d1d6c5778e3ce9d506359e51a5220b4d9 | |
parent | 12d9a36481556ba0ad25e5f68a347bdc2b3875f3 (diff) | |
download | ffmpeg-4e7b3ef3b3cf71479dde1d4ae644eaf4857c4813.tar.gz |
cinepak: Fix division by zero, ask for sample if encoded_buf_size is 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/cinepak.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index 4149a6761f..9069b7e390 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. |