From afab4c422b60e83419e10ee3dd4ba7001798b3db Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 7 Sep 2012 12:50:43 +0100 Subject: [PATCH 1/2] configure: use utilities from /usr/xpg4/bin if it exists Solaris defaults to non-standard utilities (grep, sed, ...) with proper ones being in /usr/xpg4/bin. Prefixing PATH with this directory when it exists ensures we get correct variants. Signed-off-by: Mans Rullgard --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index bcfbe4e6ec..13066e224a 100755 --- a/configure +++ b/configure @@ -54,6 +54,8 @@ if test "$E1" != 0 || test "$E2" = 0; then exit 1 fi +test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH + show_help(){ cat < Date: Fri, 15 Nov 2013 10:15:24 +0100 Subject: [PATCH 2/2] h264: check buffer size before accessing it Fixes invalid reads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC:libav-stable@libav.org --- libavcodec/h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264.c b/libavcodec/h264.c index ba8872cc5f..f021e59713 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3919,7 +3919,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){ s->workaround_bugs |= FF_BUG_TRUNCATED; if(!(s->workaround_bugs & FF_BUG_TRUNCATED)){ - while(ptr[dst_length - 1] == 0 && dst_length > 0) + while(dst_length > 0 && ptr[dst_length - 1] == 0) dst_length--; } bit_length= !dst_length ? 0 : (8*dst_length - ff_h264_decode_rbsp_trailing(h, ptr + dst_length - 1));