lavc/qsvenc: replace assert with error return
authorLinjie Fu <linjie.fu@intel.com>
Sun, 9 Dec 2018 13:30:38 +0000 (21:30 +0800)
committerZhong Li <zhong.li@intel.com>
Mon, 10 Dec 2018 03:19:24 +0000 (11:19 +0800)
commit1c96d2e3998b9a2a97447547cb2d688ec0ce09ed
tree50725906893964cda339c4708870781cf0ec658b
parentde441ad52a4d9791d93c278b4cf6867815c28b92
lavc/qsvenc: replace assert with error return

Fix the (m)jpeg encoding regression issue as decription in tikect #7593,
due to bs->FrameType is not set in such case in
MSDK (https://github.com/Intel-Media-SDK/MediaSDK/issues/970).
(And assert on a value coming from an external library is not proper.)

Add default type check for bs->FrameType, and return invalid data error in function
ff_qsv_encode to avoid using uninitialized value.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
libavcodec/qsvenc.c