[FFmpeg-cvslog] avcodec/h264_slice: Fix integer overflow with last_poc

2018-04-12 Thread Michael Niedermayer
ffmpeg | branch: release/3.3 | Michael Niedermayer  | 
Sat Apr  7 00:34:25 2018 +0200| [41458534aa8890810b678bcdb4c1c04f38b72231] | 
committer: Michael Niedermayer

avcodec/h264_slice: Fix integer overflow with last_poc

Fixes: signed integer overflow: 2147483646 - -2816 cannot be represented in 
type 'int'
Fixes: crbug 823145

Reported-by: Matt Wolenetz 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 8c02cd8ca097871dcd00cf8e08ce51660873f405)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=41458534aa8890810b678bcdb4c1c04f38b72231
---

 libavcodec/h264_slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index d83ba000ce..4d24ac6d66 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1297,7 +1297,7 @@ static int h264_select_output_frame(H264Context *h)
 }
 out_of_order = MAX_DELAYED_PIC_COUNT - i;
 if(   cur->f->pict_type == AV_PICTURE_TYPE_B
-   || (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && 
h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 
2))
+   || (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && 
h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - 
(int64_t)h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 2))
 out_of_order = FFMAX(out_of_order, 1);
 if (out_of_order == MAX_DELAYED_PIC_COUNT) {
 av_log(h->avctx, AV_LOG_VERBOSE, "Invalid POC %d<%d\n", cur->poc, 
h->last_pocs[0]);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/h264_slice: Fix integer overflow with last_poc

2018-04-12 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sat 
Apr  7 00:34:25 2018 +0200| [8c02cd8ca097871dcd00cf8e08ce51660873f405] | 
committer: Michael Niedermayer

avcodec/h264_slice: Fix integer overflow with last_poc

Fixes: signed integer overflow: 2147483646 - -2816 cannot be represented in 
type 'int'
Fixes: crbug 823145

Reported-by: Matt Wolenetz 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c02cd8ca097871dcd00cf8e08ce51660873f405
---

 libavcodec/h264_slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 90e05ed8f1..d71ddbe9ba 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1316,7 +1316,7 @@ static int h264_select_output_frame(H264Context *h)
 }
 out_of_order = MAX_DELAYED_PIC_COUNT - i;
 if(   cur->f->pict_type == AV_PICTURE_TYPE_B
-   || (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && 
h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 
2))
+   || (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && 
h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - 
(int64_t)h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 2))
 out_of_order = FFMAX(out_of_order, 1);
 if (out_of_order == MAX_DELAYED_PIC_COUNT) {
 av_log(h->avctx, AV_LOG_VERBOSE, "Invalid POC %d<%d\n", cur->poc, 
h->last_pocs[0]);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog