]> git.sesse.net Git - ffmpeg/commit
avformat/matroskadec: Improve read error/EOF checks II
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 23 Jun 2019 23:42:30 +0000 (01:42 +0200)
committerJames Almer <jamrial@gmail.com>
Tue, 25 Jun 2019 01:19:03 +0000 (22:19 -0300)
commita569a7b3bb017315b954ca686e1e8add05f07f09
treeb6d78b2f904354d6eb5bc387c17516b95a4477ac
parent239c7369e0490c6a130a1e4fd11c4fbf56379ce7
avformat/matroskadec: Improve read error/EOF checks II

This commit fixes a number of bugs:

1. There was no check that no read error/EOF occured during
ebml_read_uint, ebml_read_sint and ebml_read_float.
2. ebml_read_ascii and ebml_read_binary did sometimes not forward
error codes; instead they simply returned AVERROR(EIO).
3. In particular, AVERROR_EOF hasn't been used and no dedicated error
message for it existed. This has been changed.

In order to reduce code duplication, the new error code NEEDS_CHECKING
has been introduced which makes ebml_parse check the AVIOContext's
status for errors.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/matroskadec.c