summaryrefslogtreecommitdiffstats
path: root/contrib/ffmpeg/old/A19-h264-refs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ffmpeg/old/A19-h264-refs.patch')
-rw-r--r--contrib/ffmpeg/old/A19-h264-refs.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/contrib/ffmpeg/old/A19-h264-refs.patch b/contrib/ffmpeg/old/A19-h264-refs.patch
new file mode 100644
index 000000000..ad38b5825
--- /dev/null
+++ b/contrib/ffmpeg/old/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
+