X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fpsxstr.c;h=678b9f90aca95e0c305769805b7236fc74c74d93;hb=131f2c2712479a44332866b442526abe97e0c316;hp=f7b9495bb9f48ca757f50310185bae6cddf00d00;hpb=8e789d244cc946bc350672eeb02453918b21a09f;p=ffmpeg diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index f7b9495bb9f..678b9f90aca 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -68,7 +68,7 @@ typedef struct StrDemuxContext { static const uint8_t sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00}; -static int str_probe(AVProbeData *p) +static int str_probe(const AVProbeData *p) { const uint8_t *sector= p->buf; const uint8_t *end= sector + p->buf_size; @@ -160,7 +160,7 @@ static int str_read_packet(AVFormatContext *s, AVIOContext *pb = s->pb; StrDemuxContext *str = s->priv_data; unsigned char sector[RAW_CD_SECTOR_SIZE]; - int channel; + int channel, ret; AVPacket *pkt; AVStream *st; @@ -213,8 +213,9 @@ static int str_read_packet(AVFormatContext *s, if(pkt->data) av_log(s, AV_LOG_ERROR, "mismatching sector_count\n"); av_packet_unref(pkt); - if (av_new_packet(pkt, sector_count*VIDEO_DATA_CHUNK_SIZE)) - return AVERROR(EIO); + ret = av_new_packet(pkt, sector_count * VIDEO_DATA_CHUNK_SIZE); + if (ret < 0) + return ret; memset(pkt->data, 0, sector_count*VIDEO_DATA_CHUNK_SIZE); pkt->pos= avio_tell(pb) - RAW_CD_SECTOR_SIZE; @@ -267,8 +268,8 @@ static int str_read_packet(AVFormatContext *s, st->start_time = 0; } pkt = ret_pkt; - if (av_new_packet(pkt, 2304)) - return AVERROR(EIO); + if ((ret = av_new_packet(pkt, 2304)) < 0) + return ret; memcpy(pkt->data,sector+24,2304); pkt->stream_index =