[FFmpeg-devel] [PATCH v4 6/8] avpriv_find_start_code(): correct type of start_code parameter

Scott Theisen scott.the.elm at gmail.com
Fri Sep 16 21:20:00 EEST 2022


---
 libavcodec/mpeg12dec.c   | 2 +-
 libavformat/rtpenc_mpv.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index b857353ab8..6a7af91fad 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1746,7 +1746,7 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
 
     if (avctx->hwaccel && avctx->hwaccel->decode_slice) {
         const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
-        int start_code = -1;
+        uint32_t start_code = ~0;
         buf_end = avpriv_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
         if (buf_end < *buf + buf_size)
             buf_end -= 4;
diff --git a/libavformat/rtpenc_mpv.c b/libavformat/rtpenc_mpv.c
index 8b6987b7f2..9c0816ef95 100644
--- a/libavformat/rtpenc_mpv.c
+++ b/libavformat/rtpenc_mpv.c
@@ -51,11 +51,10 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
             end_of_slice = 1;
         } else {
             const uint8_t *r, *r1;
-            int start_code;
 
             r1 = buf1;
             while (1) {
-                start_code = -1;
+                uint32_t start_code = ~0;
                 r = avpriv_find_start_code(r1, end, &start_code);
                 if (start_code_is_valid(start_code)) {
                     /* New start code found */
-- 
2.34.1



More information about the ffmpeg-devel mailing list