[2/4] h264dec: initialize field_started to 0 on each decode call

Message ID 1482927317-26970-2-git-send-email-anton@khirnov.net
State Committed
Commit ddfec6f07431d1f354726a6069f4fa24162ac250
Headers show

Commit Message

Anton Khirnov Dec. 28, 2016, 12:15 p.m.
It might be incorrectly set to 1 if the previous call exited with an
error.

CC: libav-stable@libav.org
---
 libavcodec/h264dec.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Vittorio Giovara Jan. 3, 2017, 10:29 a.m. | #1
On Wed, Dec 28, 2016 at 1:15 PM, Anton Khirnov <anton@khirnov.net> wrote:
> It might be incorrectly set to 1 if the previous call exited with an
> error.
>
> CC: libav-stable@libav.org
> ---
>  libavcodec/h264dec.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
> index 54ded03..c308274 100644
> --- a/libavcodec/h264dec.c
> +++ b/libavcodec/h264dec.c
> @@ -520,6 +520,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
>
>      if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
>          h->current_slice = 0;
> +        h->field_started = 0;
>          if (!h->first_field)
>              h->cur_pic_ptr = NULL;
>          ff_h264_sei_uninit(&h->sei);
> --

ok
Luca Barbato Feb. 11, 2017, 9:15 p.m. | #2
On 28/12/2016 13:15, Anton Khirnov wrote:
> It might be incorrectly set to 1 if the previous call exited with an
> error.
> 
> CC: libav-stable@libav.org
> ---
>  libavcodec/h264dec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
> index 54ded03..c308274 100644
> --- a/libavcodec/h264dec.c
> +++ b/libavcodec/h264dec.c
> @@ -520,6 +520,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
>  
>      if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
>          h->current_slice = 0;
> +        h->field_started = 0;
>          if (!h->first_field)
>              h->cur_pic_ptr = NULL;
>          ff_h264_sei_uninit(&h->sei);
> 

Please add Bug-Id: 1019 and CC: libav-stable@libav.org

lu
Luca Barbato Feb. 24, 2017, 5:19 p.m. | #3
On 28/12/2016 13:15, Anton Khirnov wrote:
> It might be incorrectly set to 1 if the previous call exited with an
> error.
> 
> CC: libav-stable@libav.org
> ---
>  libavcodec/h264dec.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Actually it covers 2 more bugs reported in bugzilla.

lu

Patch

diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 54ded03..c308274 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -520,6 +520,7 @@  static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
 
     if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
         h->current_slice = 0;
+        h->field_started = 0;
         if (!h->first_field)
             h->cur_pic_ptr = NULL;
         ff_h264_sei_uninit(&h->sei);