Commit Graph

13 Commits

Author SHA1 Message Date
Andreas Rheinhardt abc6a4a6bc avformat/evcdec: Remove unused headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-05 09:40:06 +02:00
Andreas Rheinhardt e5ab2dab2c avformat/evcdec: Check that enough data has been read
Fixes potential use of uninitialized values
in evc_read_nal_unit_length().

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-09 02:40:14 +02:00
Andreas Rheinhardt 83c0f7b046 avformat/evcdec: Avoid nonsense casts
For uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE], &buf still points
to the beginning of buf, but it is of type "pointer to array of
EVC_NALU_LENGTH_PREFIX_SIZE uint8_t" (i.e. pointer arithmetic
would operate on blocks of size EVC_NALU_LENGTH_PREFIX_SIZE).
This is of course a different type than uint8_t*, which is why
there have been casts in evc_read_packet(). But these are unnecessary
if one justs removes the unnecessary address-of operator.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-07-07 03:47:29 +02:00
James Almer c7183a22db avformat/evc: move NALU length and type parsing functions to a header
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer d0d20f16ce avformat/evcdec: use an unsigned type for nalu_size
But ensure the value returned by evc_read_nal_unit_length() fits in an int.
Should prevent integer overflows later in the code.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer a6a5e53595 avformat/evcdec: flush the bsf on EOF
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer 43ace56c7e avformat/evcdec: remove unnecessary av_packet_unref() calls
And return proper error codes.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer 2276bcc52a avformat/evcdec: ensure there are enough bytes to seekback
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-21 13:31:14 -03:00
James Almer 3f48815501 avformat/evcdec: don't set AVCodecParameters.framerate
It's not necessary. Setting AVStream.avg_frame_rate is enough.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer 5a2ff43384 avformat/evcdec: simplify au_end_found check
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer ca8a660176 avformat/evcdec: simplify probe function
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-20 11:35:21 -03:00
James Almer a734fa92c8 avformat/evcdec: set the demuxer as AVFMT_NOTIMESTAMPS
Signed-off-by: James Almer <jamrial@gmail.com>
2023-06-16 09:57:35 -03:00
Dawid Kozinski ab2671c5f2 avformat/evc_demuxer: Added demuxer to handle reading EVC video files
- Provided AVInputFormat struct describing EVC input format (ff_evc_demuxer)

Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com>
2023-06-15 09:57:35 -03:00