No functional change.
---
 libavcodec/utils.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c7c7323351..42a1885d61 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -963,10 +963,11 @@ const uint8_t *avpriv_find_start_code(const uint8_t 
*av_restrict p,
         }
     }
 
-    p = FFMIN(p, end) - 4;
-    *state = AV_RB32(p);
-
-    return p + 4;
+    if (p > end)
+        p = end;
+    // read the previous 4 bytes, i.e. bytes {p - 4, p - 3, p - 2, p - 1}
+    *state = AV_RB32(p - 4);
+    return p;
 }
 
 AVCPBProperties *av_cpb_properties_alloc(size_t *size)
-- 
2.32.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to