Skip to content

Commit

Permalink
Restore hunk previously removed in r31354.
Browse files Browse the repository at this point in the history
This fixes a crash with http://samples.mplayerhq.hu/MPEG2/libmpeg2-crash.vob


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31939 b3059339-0415-0410-9bf9-f77b7e298cf2
  • Loading branch information
diego committed Aug 6, 2010
1 parent 2342639 commit 3546748
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions libmpeg2/decode.c
Expand Up @@ -345,6 +345,13 @@ void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id)
fbuf->buf[1] = buf[1];
fbuf->buf[2] = buf[2];
fbuf->id = id;
// HACK! FIXME! At first I frame, copy pointers to prediction frame too!
if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]) {
mpeg2dec->fbuf[1]->buf[0] = buf[0];
mpeg2dec->fbuf[1]->buf[1] = buf[1];
mpeg2dec->fbuf[1]->buf[2] = buf[2];
mpeg2dec->fbuf[1]->id = NULL;
}
}

void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf)
Expand Down
20 changes: 18 additions & 2 deletions libmpeg2/libmpeg2_changes.diff
Expand Up @@ -128,7 +128,7 @@ Index: libmpeg2/cpu_state.c
mpeg2_cpu_state_restore = state_restore_altivec;
--- libmpeg2/header.c 2006-06-16 20:12:26.000000000 +0200
+++ libmpeg2/header.c 2006-06-16 20:12:50.000000000 +0200
@@ -872,6 +879,7 @@
@@ -872,6 +876,7 @@
mpeg2dec->scaled[idx] = decoder->q_scale_type;
for (i = 0; i < 32; i++) {
k = decoder->q_scale_type ? non_linear_scale[i] : (i << 1);
Expand Down Expand Up @@ -355,7 +355,7 @@ Index: libmpeg2/motion_comp_vis.c
};

typedef struct {
@@ -226,7 +238,7 @@
@@ -226,7 +235,7 @@
};

typedef struct {
Expand Down Expand Up @@ -399,3 +399,19 @@ Index: libmpeg2/motion_comp_vis.c
decoder->offset += 16; \
if (decoder->offset == decoder->width) { \
do { /* just so we can use the break statement */ \
--- libmpeg2/decode.c (revision 31938)
+++ libmpeg2/decode.c (working copy)
@@ -345,6 +345,13 @@
fbuf->buf[1] = buf[1];
fbuf->buf[2] = buf[2];
fbuf->id = id;
+ // HACK! FIXME! At first I frame, copy pointers to prediction frame too!
+ if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]) {
+ mpeg2dec->fbuf[1]->buf[0] = buf[0];
+ mpeg2dec->fbuf[1]->buf[1] = buf[1];
+ mpeg2dec->fbuf[1]->buf[2] = buf[2];
+ mpeg2dec->fbuf[1]->id = NULL;
+ }
}

void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf)

0 comments on commit 3546748

Please sign in to comment.