[FFmpeg-cvslog] lavc/videotoolboxdec: fix escaping sequential zero sequences

rcombs git at videolan.org
Thu Jun 2 04:14:38 EEST 2022


ffmpeg | branch: master | rcombs <rcombs at rcombs.me> | Sat Apr 16 02:47:30 2022 -0500| [686b64e15526fbc1410104212aa291b66b0f488e] | committer: rcombs

lavc/videotoolboxdec: fix escaping sequential zero sequences

This ensure that e.g. 0000000000 becomes 00000300 000300,
rather than 00000300 0000.

Signed-off-by: rcombs <rcombs at rcombs.me>

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

 libavcodec/videotoolbox.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 7c4c4c6e1b..a1933f03f2 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -166,14 +166,13 @@ static int escape_ps(uint8_t* dst, const uint8_t* src, int src_size)
             src[i + 2] <= 0x03) {
             if (dst) {
                 *p++ = src[i++];
-                *p++ = src[i++];
+                *p++ = src[i];
                 *p++ = 0x03;
             } else {
-                i += 2;
+                i++;
             }
             size++;
-        }
-        if (dst)
+        } else if (dst)
             *p++ = src[i];
     }
 



More information about the ffmpeg-cvslog mailing list