Message ID | 20160906145317.19106-1-matthieu.bouron@gmail.com |
---|---|
State | Accepted |
Commit | f574012d5fe922684a5befa16828f22fe9a83ce8 |
Headers | show |
Hi, On 06/09/2016 16:53, Matthieu Bouron wrote: > From: Matthieu Bouron <matthieu.bouron@stupeflix.com> > > Fixes escaping of consecutive 0x00, 0x00, 0x0{0-3} sequences. > --- > libavcodec/mediacodecdec_h264.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/mediacodecdec_h264.c b/libavcodec/mediacodecdec_h264.c > index a141174..4f9d737 100644 > --- a/libavcodec/mediacodecdec_h264.c > +++ b/libavcodec/mediacodecdec_h264.c > @@ -104,9 +104,9 @@ static int h264_ps_to_nalu(const uint8_t *src, int src_size, uint8_t **out, int > } > *out = p = new; > > - i = i + 3; > - memmove(p + i, p + i - 1, *out_size - i); > - p[i - 1] = 0x03; > + i = i + 2; > + memmove(p + i + 1, p + i, *out_size - (i + 1)); > + p[i] = 0x03; LGTM
On Wed, Sep 07, 2016 at 02:50:18PM +0200, Benoit Fouet wrote: > Hi, > > > On 06/09/2016 16:53, Matthieu Bouron wrote: > > From: Matthieu Bouron <matthieu.bouron@stupeflix.com> > > > > Fixes escaping of consecutive 0x00, 0x00, 0x0{0-3} sequences. > > --- > > libavcodec/mediacodecdec_h264.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/libavcodec/mediacodecdec_h264.c b/libavcodec/mediacodecdec_h264.c > > index a141174..4f9d737 100644 > > --- a/libavcodec/mediacodecdec_h264.c > > +++ b/libavcodec/mediacodecdec_h264.c > > @@ -104,9 +104,9 @@ static int h264_ps_to_nalu(const uint8_t *src, int src_size, uint8_t **out, int > > } > > *out = p = new; > > - i = i + 3; > > - memmove(p + i, p + i - 1, *out_size - i); > > - p[i - 1] = 0x03; > > + i = i + 2; > > + memmove(p + i + 1, p + i, *out_size - (i + 1)); > > + p[i] = 0x03; > > LGTM Pushed. Thanks for the review. Matthieu [...]
diff --git a/libavcodec/mediacodecdec_h264.c b/libavcodec/mediacodecdec_h264.c index a141174..4f9d737 100644 --- a/libavcodec/mediacodecdec_h264.c +++ b/libavcodec/mediacodecdec_h264.c @@ -104,9 +104,9 @@ static int h264_ps_to_nalu(const uint8_t *src, int src_size, uint8_t **out, int } *out = p = new; - i = i + 3; - memmove(p + i, p + i - 1, *out_size - i); - p[i - 1] = 0x03; + i = i + 2; + memmove(p + i + 1, p + i, *out_size - (i + 1)); + p[i] = 0x03; } } done:
From: Matthieu Bouron <matthieu.bouron@stupeflix.com> Fixes escaping of consecutive 0x00, 0x00, 0x0{0-3} sequences. --- libavcodec/mediacodecdec_h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)