Opened 16 years ago

Closed 15 years ago

#5150 closed defect (invalid)

save_read can return -1 or differing save count when called

Reported by: Erik Hovland <erik@…> Owned by: Janne Grunau
Priority: trivial Milestone: 0.22
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

save_read can return -1 or a different saved count of bytes when called. That means callers of it should check to make sure it worked. There are two calls in mythtranscode of this function.

Attachments (4)

programs_mythtranscode_replex_replex.c-check-save_read-count-in-init_replex.patch (994 bytes) - added by Erik Hovland <erik@…> 16 years ago.
check save_read for errors and report
programs_mythtranscode_replex_replex.c-check-save_read-count-in-replex_fill_buffers.patch (1.4 KB) - added by Erik Hovland <erik@…> 16 years ago.
check save_read for errors and report
programs_mythtranscode_replex_replex.c-check-save_read-count-in-replex_fill_buffers-ticket-5150.patch (975 bytes) - added by Erik Hovland <erik@…> 15 years ago.
update the patch to return instead of perror
programs_mythtranscode_replex_replex.c-check-save_read-count-in-replex_fill_buffers-ticket-5150.2.patch (975 bytes) - added by Erik Hovland <erik@…> 15 years ago.
Fresh patch for old ticket.

Download all attachments as: .zip

Change History (9)

Changed 16 years ago by Erik Hovland <erik@…>

check save_read for errors and report

Changed 16 years ago by Erik Hovland <erik@…>

check save_read for errors and report

comment:1 Changed 15 years ago by danielk

Status: newinfoneeded_new

Erik, we do not like to call exit() or abort() from deep within the application, can you rework the patch so that the error condition is passed up to main.cpp ?

Changed 15 years ago by Erik Hovland <erik@…>

update the patch to return instead of perror

comment:2 Changed 15 years ago by Erik Hovland <erik@…>

Funny enough, the original code had the perror.

comment:3 Changed 15 years ago by danielk

Status: infoneeded_newnew

Gah! perror is fine where we are not using the VERBOSE macro. It's the original code that is stewn with exit() calls and you removed one in your patch. 34 just in that file, yikes!

Changed 15 years ago by Erik Hovland <erik@…>

Fresh patch for old ticket.

comment:4 Changed 15 years ago by Janne Grunau

Milestone: unknown0.22
Owner: changed from Isaac Richards to Janne Grunau
Status: newassigned

comment:5 Changed 15 years ago by Janne Grunau

Resolution: invalid
Status: assignedclosed

there are ATM only two locations which check only that save_read is non negative.

Both read from the start of the file so it's sane to assume that the read either fail or are complete. The patches in this ticket change different parts of the file,

Since it's imported code we shouldn't not change too much like replacing all perror/exit with proper error handling.

Note: See TracTickets for help on using tickets.