hevc: make avcodec_decode_video2() fail if get_format() fails
authorwm4 <nfxjfg@googlemail.com>
Thu, 14 May 2015 16:27:31 +0000 (18:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 21 May 2015 18:43:39 +0000 (20:43 +0200)
commit02c1074f18f6d696122e1fc098bff8e9b6adcae8
treead9586795fc8aa0eddccd6d61d46821e21b8d57e
parentdb00ecbc96a4056f2c9890f45839f422cae2b799
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: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc5e4bb48476a89cc8ce0c41bc2bd2e8fda9b37c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/hevc.c