History

cinepak: Add another special case 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.

Mike Melanson committed 15 years ago

Commit 747283a1 parent ffc638c1 file · +3 −2Browse files

Unified · Split

libavcodec/cinepak.c+3−2
@@ -330,12 +330,13 @@ static int cinepak_decode (CinepakContext *s) · 329 unmodified lines
330330
331331 /* if this is the first frame, check for deviant Sega FILM data */
332332 if (s->sega_film_skip_bytes == -1) {
333− if (encoded_buf_size != s->size) {
333+ if (encoded_buf_size != s->size && (s->size % encoded_buf_size) != 0) {
334334 /* If the encoded frame size differs from the frame size as indicated
335335 * by the container file, this data likely comes from a Sega FILM/CPK file.
336336 * If the frame header is followed by the bytes FE 00 00 06 00 00 then
337337 * this is probably one of the two known files that have 6 extra bytes
338− * after the frame header. Else, assume 2 extra bytes. */
338+ * after the frame header. Else, assume 2 extra bytes. The container
339+ * size also cannot be a multiple of the encoded size. */
339340 if (s->size >= 16 &&
340341 (s->data[10] == 0xFE) &&
341342 (s->data[11] == 0x00) &&

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t