X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fpsxstr.c;h=678b9f90aca95e0c305769805b7236fc74c74d93;hb=cb9dbc60db1847fcb594684b92334da54ea8757e;hp=ddc17e35d2a8b6447b762a29a45415f28976e326;hpb=3e076faf3b86bb16f746e7c9b0cf3dac5f9a851a;p=ffmpeg diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index ddc17e35d2a..678b9f90aca 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -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 =