You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avformat/rpl: check av_get_packet() for failure
Also make ret signed as it should be from start. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
		| @@ -278,7 +278,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) | ||||
|     AVIOContext *pb = s->pb; | ||||
|     AVStream* stream; | ||||
|     AVIndexEntry* index_entry; | ||||
|     uint32_t ret; | ||||
|     int ret; | ||||
|  | ||||
|     if (rpl->chunk_part == s->nb_streams) { | ||||
|         rpl->chunk_number++; | ||||
| @@ -308,6 +308,8 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) | ||||
|             return AVERROR(EIO); | ||||
|  | ||||
|         ret = av_get_packet(pb, pkt, frame_size); | ||||
|         if (ret < 0) | ||||
|             return ret; | ||||
|         if (ret != frame_size) { | ||||
|             av_free_packet(pkt); | ||||
|             return AVERROR(EIO); | ||||
| @@ -323,6 +325,8 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) | ||||
|         } | ||||
|     } else { | ||||
|         ret = av_get_packet(pb, pkt, index_entry->size); | ||||
|         if (ret < 0) | ||||
|             return ret; | ||||
|         if (ret != index_entry->size) { | ||||
|             av_free_packet(pkt); | ||||
|             return AVERROR(EIO); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user