[FFmpeg-cvslog] avcodec/h264_parse: no need check ref list1 for P slices.
Decai Lin
git at videolan.org
Fri Feb 8 13:21:01 EET 2019
ffmpeg | branch: master | Decai Lin <decai.lin at intel.com> | Thu Jan 31 15:36:56 2019 +0800| [9d800d39d557965d63eb671a6de50d0c6ef6d4ab] | committer: Michael Niedermayer
avcodec/h264_parse: no need check ref list1 for P slices.
This is robust for some corner case there is incorrect list1 count
in pps header, but it's a P slice and can be decoded well.
Signed-off-by: Decai Lin <decai.lin at intel.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9d800d39d557965d63eb671a6de50d0c6ef6d4ab
---
libavcodec/h264_parse.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index 290ab681a9..a42cc299ff 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -242,7 +242,12 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
ref_count[1] = 1;
}
- if (ref_count[0] - 1 > max[0] || ref_count[1] - 1 > max[1]) {
+ if (slice_type_nos == AV_PICTURE_TYPE_B)
+ list_count = 2;
+ else
+ list_count = 1;
+
+ if (ref_count[0] - 1 > max[0] || (list_count == 2 && (ref_count[1] - 1 > max[1]))) {
av_log(logctx, AV_LOG_ERROR, "reference overflow %u > %u or %u > %u\n",
ref_count[0] - 1, max[0], ref_count[1] - 1, max[1]);
ref_count[0] = ref_count[1] = 0;
@@ -250,10 +255,6 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
goto fail;
}
- if (slice_type_nos == AV_PICTURE_TYPE_B)
- list_count = 2;
- else
- list_count = 1;
} else {
list_count = 0;
ref_count[0] = ref_count[1] = 0;
More information about the ffmpeg-cvslog
mailing list