summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-04-11 13:25:51 -0600
committerJohn Stebbins <[email protected]>2017-04-11 13:25:51 -0600
commit420f90fe9efdb44049f783f93f6378f7785e532d (patch)
treeb7c95ba17049e8df0fb7e1d3000ca06b92b4ec8a
parent7e346baaa3ce8df0b03ab64ce78434aa68a8b5d3 (diff)
libav: fix h264 decode error
Fixes https://github.com/HandBrake/HandBrake/issues/602
-rw-r--r--contrib/ffmpeg/A19-h264-refs.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A19-h264-refs.patch b/contrib/ffmpeg/A19-h264-refs.patch
new file mode 100644
index 000000000..ad38b5825
--- /dev/null
+++ b/contrib/ffmpeg/A19-h264-refs.patch
@@ -0,0 +1,35 @@
+From dde41279a91fce7abf2687c34bb8529b66298466 Mon Sep 17 00:00:00 2001
+From: Michael Niedermayer <[email protected]>
+Date: Sun, 1 May 2011 02:32:41 +0200
+Subject: [PATCH] h264_refs: Fix decode error when too many refs
+
+This improves upon a commit that was meant to fix intra only decoding.
+The prior code caused decode errors in non-intra only.
+
+H264: Fix intra only decoding.
+This possibly fixes issue2679
+Signed-off-by: Michael Niedermayer <[email protected]>
+
+(cherry picked from commit c059d7aa57391f2216808dbf2afdcb9e0a835ab5)
+---
+ libavcodec/h264_refs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
+index b4dc49c..1b9ecc9 100644
+--- a/libavcodec/h264_refs.c
++++ b/libavcodec/h264_refs.c
+@@ -697,8 +697,8 @@ int ff_h264_execute_ref_pic_marking(H264Context *h)
+ }
+ }
+
+- if (h->long_ref_count + h->short_ref_count -
+- (h->short_ref[0] == h->cur_pic_ptr) > h->ps.sps->ref_frame_count) {
++ if (h->long_ref_count + h->short_ref_count >
++ FFMAX(h->ps.sps->ref_frame_count, 1)) {
+
+ /* We have too many reference frames, probably due to corrupted
+ * stream. Need to discard one frame. Prevents overrun of the
+--
+2.9.3
+