aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cinepak.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-11-16 15:10:26 +0100
committerMartin Storsjö <martin@martin.st>2011-11-18 11:35:56 +0200
commitb55aa7df6b79746541f05d65c414961f49f46f68 (patch)
tree7c5823ba50f5c683780d4ac49a1c7ff03535947a /libavcodec/cinepak.c
parent795d9594cfaf9b6c9ce0c60f86c6e51636096a5a (diff)
downloadandroid_external_ffmpeg-b55aa7df6b79746541f05d65c414961f49f46f68.tar.gz
android_external_ffmpeg-b55aa7df6b79746541f05d65c414961f49f46f68.tar.bz2
android_external_ffmpeg-b55aa7df6b79746541f05d65c414961f49f46f68.zip
cinepak: Fix division by zero, ask for sample if encoded_buf_size is 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/cinepak.c')
-rw-r--r--libavcodec/cinepak.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index f8b5352e35..0dbdeab354 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.