avcodec: set correct return value in ff_mpeg_ref_picture
authorPan Bian <bianpan2016@163.com>
Mon, 27 Nov 2017 12:41:10 +0000 (20:41 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 28 Nov 2017 20:42:48 +0000 (21:42 +0100)
commit89f9332fdf8948daa50a29e1a9fa9488041351a3
treefdc43b7be7880e44fc4f4d9f0174f9710a8c3769
parent96e340760824e537e2d034abf9a3b8be3e2b312c
avcodec: set correct return value in ff_mpeg_ref_picture

In function ff_mpeg_ref_picture(), it returns 0 on the error path that
the return value of av_buffer_ref() is NULL. 0 indicates success, which
seems to deviate from the fact. Set ret to AVERROR(ENOMEM) to propagate
the error status to the callers.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mpegpicture.c