diff mbox

[FFmpeg-devel] avformat/rtpdec_h264: Fix heap-buffer-overflow

Message ID 20170823205042.25170-1-michael@niedermayer.cc
State Accepted
Commit c42a1388a6d1bfd8001bf6a4241d8ca27e49326d
Headers show

Commit Message

Michael Niedermayer Aug. 23, 2017, 8:50 p.m. UTC
Fixes: rtp_sdp/poc.sdp

Found-by: Bingchang <l.bing.chang.bc@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/rtpdec_h264.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Aug. 24, 2017, 8:58 a.m. UTC | #1
On Wed, Aug 23, 2017 at 10:50:42PM +0200, Michael Niedermayer wrote:
> Fixes: rtp_sdp/poc.sdp
> 
> Found-by: Bingchang <l.bing.chang.bc@gmail.com>
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/rtpdec_h264.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

[...]
diff mbox

Patch

diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c
index 8dd56a549e..6f8148ab6d 100644
--- a/libavformat/rtpdec_h264.c
+++ b/libavformat/rtpdec_h264.c
@@ -166,7 +166,7 @@  static int sdp_parse_fmtp_config_h264(AVFormatContext *s,
             parse_profile_level_id(s, h264_data, value);
     } else if (!strcmp(attr, "sprop-parameter-sets")) {
         int ret;
-        if (value[strlen(value) - 1] == ',') {
+        if (*value == 0 || value[strlen(value) - 1] == ',') {
             av_log(s, AV_LOG_WARNING, "Missing PPS in sprop-parameter-sets, ignoring\n");
             return 0;
         }