On 2014-02-07 11:51:18 +0100, Vittorio Giovara wrote:
> ---
> libavcodec/h264.c | 19 ++++++++++++++-----
> 1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index da2d4a5..0cbe944 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -4787,7 +4787,9 @@ again:
> break;
> case NAL_SEI:
> init_get_bits(&h->gb, ptr, bit_length);
> - ff_h264_decode_sei(h);
> + ret = ff_h264_decode_sei(h);
> + if (ret < 0)
> + goto end;
at least the commit message is misleading, it doesn't only report
errors but aborts the decoding of the frame on the first error.
If that's the desired effect it should be explicit about it.
Not sure if errors in ff_h264_decode_sei should be fatal unless
AV_EF_EXPLODE is set
> break;
> case NAL_SPS:
> init_get_bits(&h->gb, ptr, bit_length);
> @@ -4807,7 +4809,9 @@ again:
> break;
> case NAL_PPS:
> init_get_bits(&h->gb, ptr, bit_length);
> - ff_h264_decode_picture_parameter_set(h, bit_length);
> + ret = ff_h264_decode_picture_parameter_set(h, bit_length);
> + if (ret < 0)
> + goto end;
This might make sense but I think we error out later if the pps for the
current frame is not available so this probably shouldnt be fatal either
> break;
> case NAL_AUD:
> case NAL_END_SEQUENCE:
> @@ -4824,7 +4828,9 @@ again:
> }
>
> if (context_count == h->max_contexts) {
> - execute_decode_slices(h, context_count);
> + ret = execute_decode_slices(h, context_count);
> + if (ret < 0)
> + goto end;
no reason to stop decoding just because one slice is damaged unless
AV_EF_EXPLODE is set
> context_count = 0;
> }
>
> @@ -4843,8 +4849,11 @@ again:
> }
> }
> }
> - if (context_count)
> - execute_decode_slices(h, context_count);
> + if (context_count) {
> + ret = execute_decode_slices(h, context_count);
> + if (ret < 0)
> + goto end;
> + }
same
Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel