summaryrefslogtreecommitdiff
path: root/libavcodec/cinepak.c
diff options
context:
space:
mode:
authorMike Melanson <mike@multimedia.cx>2011-11-15 23:06:48 -0800
committerMichael Niedermayer <michaelni@gmx.at>2011-11-16 15:13:01 +0100
commit12d9a36481556ba0ad25e5f68a347bdc2b3875f3 (patch)
treee44dc9692e73738ae91edd6430e4408c97f2f6fb /libavcodec/cinepak.c
parent974d25e2db96f95770f92a616b7508c9cbf62804 (diff)
Add another special case to the Cinepak video decoder so that it can handle the following file:
http://samples.mplayerhq.hu/V-codecs/CVID/bad_cinepak_frame_size.mov This fix works around another work around which handles a different type of odd Cinepak data. Thanks to Matthew Hoops (clone2727 - gmail.com) for the sample and fix. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cinepak.c')
-rw-r--r--libavcodec/cinepak.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
index b748f278ef..4149a6761f 100644
--- a/libavcodec/cinepak.c
+++ b/libavcodec/cinepak.c
@@ -330,12 +330,13 @@ 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 != s->size) {
+ 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.
* If the frame header is followed by the bytes FE 00 00 06 00 00 then
* this is probably one of the two known files that have 6 extra bytes
- * after the frame header. Else, assume 2 extra bytes. */
+ * after the frame header. Else, assume 2 extra bytes. The container size
+ * size also cannot be a multiple of the encoded size. */
if (s->size >= 16 &&
(s->data[10] == 0xFE) &&
(s->data[11] == 0x00) &&