mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-24 17:12:34 +02:00
avformat/evcdec: ensure there are enough bytes to seekback
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
83b3ff741b
commit
2276bcc52a
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "rawdec.h"
|
#include "rawdec.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
|
#include "avio_internal.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
|
||||||
@ -192,8 +193,12 @@ static int evc_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while(!au_end_found) {
|
while(!au_end_found) {
|
||||||
|
|
||||||
uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE];
|
uint8_t buf[EVC_NALU_LENGTH_PREFIX_SIZE];
|
||||||
|
|
||||||
|
ret = ffio_ensure_seekback(s->pb, EVC_NALU_LENGTH_PREFIX_SIZE);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
ret = avio_read(s->pb, (unsigned char *)&buf, EVC_NALU_LENGTH_PREFIX_SIZE);
|
ret = avio_read(s->pb, (unsigned char *)&buf, EVC_NALU_LENGTH_PREFIX_SIZE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_packet_unref(pkt);
|
av_packet_unref(pkt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user