if(ret != 8 * packet_size * sizeof(uint16_t))
return AVERROR(EIO);
- if (av_new_packet(pkt, packet_size) < 0)
- return AVERROR(ENOMEM);
+ if ((ret = av_new_packet(pkt, packet_size)) < 0)
+ return ret;
init_put_bits(&pbo, pkt->data, packet_size);
for(j=0; j < packet_size; j++)