Commit cc5e4bb4 authored by wm4's avatar wm4 Committed by Michael Niedermayer

hevc: make avcodec_decode_video2() fail if get_format() fails

Personally, I need the decoder to back out if get_format() returns no
usable pixel format. This didn't work because the error code was not
propagated down the call chain. This in turn happened because the
variable declaration removed in this patch shadowed the variable, whose
value is returned at the end of the function. Consequently, failures of
decode_nal_unit() were ignored in this place.
Reviewed-by: 's avatarAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent f6b8b966
...@@ -3000,7 +3000,6 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) ...@@ -3000,7 +3000,6 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
/* parse the NAL units */ /* parse the NAL units */
for (i = 0; i < s->nb_nals; i++) { for (i = 0; i < s->nb_nals; i++) {
int ret;
s->skipped_bytes = s->skipped_bytes_nal[i]; s->skipped_bytes = s->skipped_bytes_nal[i];
s->skipped_bytes_pos = s->skipped_bytes_pos_nal[i]; s->skipped_bytes_pos = s->skipped_bytes_pos_nal[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment