[FFmpeg-cvslog] Merge commit '61bd0ed781b56eea1e8e851aab34a2ee3b59fbac'

Hendrik Leppkes git at videolan.org
Thu Nov 17 16:25:04 EET 2016


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Thu Nov 17 15:24:25 2016 +0100| [2f1a539d4b905a418aec4b420adcb7648eba5c64] | committer: Hendrik Leppkes

Merge commit '61bd0ed781b56eea1e8e851aab34a2ee3b59fbac'

* commit '61bd0ed781b56eea1e8e851aab34a2ee3b59fbac':
  h264: Log more information about invalid NALu size

Merged-by: Hendrik Leppkes <h.leppkes at gmail.com>

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

 libavcodec/h2645_parse.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h
index 3a60f3f..5f3e17a 100644
--- a/libavcodec/h2645_parse.h
+++ b/libavcodec/h2645_parse.h
@@ -104,7 +104,7 @@ static inline int get_nalsize(int nal_length_size, const uint8_t *buf,
         nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
     if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
         av_log(logctx, AV_LOG_ERROR,
-               "Invalid nal size %d\n", nalsize);
+               "Invalid NAL unit size (%d > %d).\n", nalsize, buf_size - *buf_index);
         return AVERROR_INVALIDDATA;
     }
     return nalsize;


======================================================================

diff --cc libavcodec/h2645_parse.h
index 3a60f3f,9cc4441..5f3e17a
--- a/libavcodec/h2645_parse.h
+++ b/libavcodec/h2645_parse.h
@@@ -90,24 -85,4 +90,24 @@@ int ff_h2645_packet_split(H2645Packet *
   */
  void ff_h2645_packet_uninit(H2645Packet *pkt);
  
 +static inline int get_nalsize(int nal_length_size, const uint8_t *buf,
 +                              int buf_size, int *buf_index, void *logctx)
 +{
 +    int i, nalsize = 0;
 +
 +    if (*buf_index >= buf_size - nal_length_size) {
 +        // the end of the buffer is reached, refill it
 +        return AVERROR(EAGAIN);
 +    }
 +
 +    for (i = 0; i < nal_length_size; i++)
 +        nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
 +    if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
 +        av_log(logctx, AV_LOG_ERROR,
-                "Invalid nal size %d\n", nalsize);
++               "Invalid NAL unit size (%d > %d).\n", nalsize, buf_size - *buf_index);
 +        return AVERROR_INVALIDDATA;
 +    }
 +    return nalsize;
 +}
 +
  #endif /* AVCODEC_H2645_PARSE_H */



More information about the ffmpeg-cvslog mailing list